aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-23 23:59:39 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-23 23:59:39 +0100
commitd753b048a912a090a329cbbf6beebadc88c019be (patch)
tree433dab13c536f37fb7e95024f094506d9d4f649b /packages/main/src
parentfeat: Set some options in main process (diff)
downloadsophie-d753b048a912a090a329cbbf6beebadc88c019be.tar.gz
sophie-d753b048a912a090a329cbbf6beebadc88c019be.tar.zst
sophie-d753b048a912a090a329cbbf6beebadc88c019be.zip
feat: Set up partition persistence
Diffstat (limited to 'packages/main/src')
-rw-r--r--packages/main/src/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts
index 0530e32..f56d629 100644
--- a/packages/main/src/index.ts
+++ b/packages/main/src/index.ts
@@ -39,6 +39,11 @@ import { createRootStore } from './stores/RootStore';
39const isSingleInstance = app.requestSingleInstanceLock(); 39const isSingleInstance = app.requestSingleInstanceLock();
40const isDevelopment = import.meta.env.MODE === 'development'; 40const isDevelopment = import.meta.env.MODE === 'development';
41 41
42// Use alternative directory when debugging to avoid clobbering the main installation.
43if (isDevelopment) {
44 app.setPath('userData', `${app.getPath('userData')}-dev`);
45}
46
42if (!isSingleInstance) { 47if (!isSingleInstance) {
43 app.quit(); 48 app.quit();
44 process.exit(0); 49 process.exit(0);
@@ -124,7 +129,7 @@ async function createWindow(): Promise<void> {
124 const browserView = new BrowserView({ 129 const browserView = new BrowserView({
125 webPreferences: { 130 webPreferences: {
126 sandbox: true, 131 sandbox: true,
127 partition: 'service', 132 partition: 'persist:service',
128 }, 133 },
129 }); 134 });
130 135