From 3fd146a55a67d58d23fd92866d3948689d91080d Mon Sep 17 00:00:00 2001 From: Tom Trevethan Date: Mon, 11 Mar 2024 17:16:15 +0000 Subject: [PATCH] DB file path --- clients/react-app/src/main/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/react-app/src/main/index.js b/clients/react-app/src/main/index.js index 1d8f1f28..85cb46d0 100644 --- a/clients/react-app/src/main/index.js +++ b/clients/react-app/src/main/index.js @@ -72,8 +72,10 @@ app.whenReady().then(async () => { try { // where to put that code? + const appDataPath = app.getPath('appData'); const databaseFile = 'wallet.db' // config.get('databaseFile') - db = new sqlite3.Database(databaseFile) + const dbFilePath = path.join(appDataPath, databaseFile) + db = new sqlite3.Database(dbFilePath) await sqliteManager.createTables(db) } catch (error) { console.log('Database intialization Error:', error)