From 2032f647669f82e70d659d88edf583941d8afe49 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 4 Nov 2022 14:58:23 +0000 Subject: [PATCH] Ensure EventStore is created in the appropriate userData directory (#433) --- src/seshat.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/seshat.ts b/src/seshat.ts index 77022b9..3e90659 100644 --- a/src/seshat.ts +++ b/src/seshat.ts @@ -47,8 +47,6 @@ try { } } -const eventStorePath = path.join(app.getPath('userData'), 'EventStore'); - let eventIndex: SeshatType | null = null; const seshatDefaultPassphrase = "DEFAULT_PASSPHRASE"; @@ -80,6 +78,9 @@ const deleteContents = async (p: string): Promise => { ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { if (!global.mainWindow) return; + // We do this here to ensure we get the path after --profile has been resolved + const eventStorePath = path.join(app.getPath('userData'), 'EventStore'); + const sendError = (id, e) => { const error = { message: e.message,