diff --git a/main.js b/main.js index 58f5393..285135e 100644 --- a/main.js +++ b/main.js @@ -20,7 +20,7 @@ na.sodium_free = function sodium_free_monkey_patched() {} process.env.ZOOBOARD_DATA ??= Path.join(app.getPath('appData'), 'zooboard') app.setPath('userData', process.env.ZOOBOARD_DATA) -const path = Path.resolve(app.getPath('userData'), 'ppppp') +const path = process.env.PZP_DIR ?? Path.resolve(app.getPath('userData'), 'ppppp') const keypairPath = Path.join(path, 'keypair.json') const keypair = Keypair.loadOrCreateSync(keypairPath) @@ -277,20 +277,20 @@ if (process.defaultApp) { app.setAsDefaultProtocolClient('ppppp') } -const hasLock = app.requestSingleInstanceLock() +//const hasLock = app.requestSingleInstanceLock() -if (!hasLock) { - app.quit() -} else { - app.on('second-instance', (ev, argv, cwd, extraData) => { - if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore() - mainWindow.focus() - if (argv.length > 1) { - handlePPPPPUri(null, argv[argv.length - 1]) - } - } - }) +//if (!hasLock) { +// app.quit() +//} else { +// app.on('second-instance', (ev, argv, cwd, extraData) => { +// if (mainWindow) { +// if (mainWindow.isMinimized()) mainWindow.restore() +// mainWindow.focus() +// if (argv.length > 1) { +// handlePPPPPUri(null, argv[argv.length - 1]) +// } +// } +// }) app.whenReady().then(() => { ipcMain.handle('loadAccount', loadAccount) @@ -313,4 +313,4 @@ if (!hasLock) { if (process.platform !== 'darwin') app.quit() }) }) -} +//} diff --git a/package.json b/package.json index 49aeaa5..a6f4c3a 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,13 @@ "main": "main.js", "homepage": "./", "scripts": { - "start": "BROWSER=none react-scripts start", + "start": "PORT=3001 BROWSER=none react-scripts start", + "start2": "PZP_DIR=/tmp/zooboard-test PORT=3002 BROWSER=none react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "electron": "ELECTRON_START_URL=http://localhost:3000 DEBUG=*,-shse,-pull-secretstream electron ." + "electron": "ELECTRON_START_URL=http://localhost:3001 DEBUG=*,-shse,-pull-secretstream electron .", + "electron2": "PZP_DIR=/tmp/zooboard-test ELECTRON_START_URL=http://localhost:3002 DEBUG=*,-shse,-pull-secretstream electron ." }, "dependencies": { "@excalidraw/excalidraw": "0.17.2",