Store GUI config under user data

This commit is contained in:
thePR0M3TH3AN
2025-06-21 17:10:28 -04:00
parent dc0614c819
commit 20b61cfc16
2 changed files with 17 additions and 1 deletions

View File

@@ -82,7 +82,18 @@ app.whenReady().then(() => {
});
function getConfigPath() {
return path.join(__dirname, '..', '..', 'voxvera', 'src', 'config.json');
const userDir = app.getPath('userData');
const cfgPath = path.join(userDir, 'config.json');
if (!fs.existsSync(cfgPath)) {
try {
fs.mkdirSync(userDir, { recursive: true });
const defaultCfg = path.join(__dirname, '..', '..', 'voxvera', 'src', 'config.json');
fs.copyFileSync(defaultCfg, cfgPath);
} catch (err) {
dialog.showErrorBox('Config error', err.message);
}
}
return cfgPath;
}
ipcMain.handle('load-config', async () => {