diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-12-23 23:59:39 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-12-23 23:59:39 +0100 |
commit | d753b048a912a090a329cbbf6beebadc88c019be (patch) | |
tree | 433dab13c536f37fb7e95024f094506d9d4f649b | |
parent | feat: Set some options in main process (diff) | |
download | sophie-d753b048a912a090a329cbbf6beebadc88c019be.tar.gz sophie-d753b048a912a090a329cbbf6beebadc88c019be.tar.zst sophie-d753b048a912a090a329cbbf6beebadc88c019be.zip |
feat: Set up partition persistence
-rw-r--r-- | packages/main/src/index.ts | 7 |
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'; | |||
39 | const isSingleInstance = app.requestSingleInstanceLock(); | 39 | const isSingleInstance = app.requestSingleInstanceLock(); |
40 | const isDevelopment = import.meta.env.MODE === 'development'; | 40 | const isDevelopment = import.meta.env.MODE === 'development'; |
41 | 41 | ||
42 | // Use alternative directory when debugging to avoid clobbering the main installation. | ||
43 | if (isDevelopment) { | ||
44 | app.setPath('userData', `${app.getPath('userData')}-dev`); | ||
45 | } | ||
46 | |||
42 | if (!isSingleInstance) { | 47 | if (!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 | ||