From fc6555778310257d856b97bd16e9b0c6b81a6ceb Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Wed, 21 Feb 2024 10:13:29 +0200 Subject: [PATCH] cosmetic refactor --- main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 2192828..eb4b54f 100644 --- a/main.js +++ b/main.js @@ -5,18 +5,18 @@ const p = require('node:util').promisify const Keypair = require('ppppp-keypair') const awaitable = require('pull-awaitable') -// WARNING monkey patch! -------------------------------------- +// WARNING monkey patch! ------------------------------------------------------- const na = require('sodium-native') na.sodium_malloc = function sodium_malloc_monkey_patched(n) { return Buffer.alloc(n) } na.sodium_free = function sodium_free_monkey_patched() {} -// Electron > 20.3.8 breaks a napi method that `sodium_malloc` -// depends on to create external buffers. (see v8 memory cage) +// Electron > 20.3.8 breaks a napi method that `sodium_malloc` depends on to +// create external buffers. (see v8 memory cage) // -// This crashes electron when called by various libraries, so -// we monkey-patch this particular function. -// ------------------------------------------------------------ +// This crashes electron when called by various libraries, so we monkey-patch +// this particular function. +// ----------------------------------------------------------------------------- process.env.ZOOBOARD_DATA ??= Path.join(app.getPath('appData'), 'zooboard') app.setPath('userData', process.env.ZOOBOARD_DATA)