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)