diff options
Diffstat (limited to 'packages/main/src/index.ts')
-rw-r--r-- | packages/main/src/index.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 3e9e338..7c7be35 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts | |||
@@ -41,7 +41,7 @@ import { | |||
41 | } from '@sophie/shared'; | 41 | } from '@sophie/shared'; |
42 | import { URL } from 'url'; | 42 | import { URL } from 'url'; |
43 | 43 | ||
44 | import { CompositionRoot } from './CompositionRoot'; | 44 | import { init } from './compositionRoot'; |
45 | import { | 45 | import { |
46 | installDevToolsExtensions, | 46 | installDevToolsExtensions, |
47 | openDevToolsWhenReady, | 47 | openDevToolsWhenReady, |
@@ -104,13 +104,11 @@ if (isDevelopment) { | |||
104 | let mainWindow: BrowserWindow | null = null; | 104 | let mainWindow: BrowserWindow | null = null; |
105 | 105 | ||
106 | const store = createMainStore(); | 106 | const store = createMainStore(); |
107 | const compositionRoot = new CompositionRoot(); | 107 | init(store).then((disposeCompositionRoot) => { |
108 | compositionRoot.init(store).catch((err) => { | 108 | app.on('will-quit', disposeCompositionRoot); |
109 | }).catch((err) => { | ||
109 | console.log('Failed to initialize application', err); | 110 | console.log('Failed to initialize application', err); |
110 | }); | 111 | }); |
111 | app.on('will-quit', () => { | ||
112 | compositionRoot.dispose(); | ||
113 | }); | ||
114 | 112 | ||
115 | const rendererBaseUrl = getResourceUrl('../renderer/'); | 113 | const rendererBaseUrl = getResourceUrl('../renderer/'); |
116 | function shouldCancelMainWindowRequest(url: string, method: string): boolean { | 114 | function shouldCancelMainWindowRequest(url: string, method: string): boolean { |