aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/stores/MainStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/main/src/stores/MainStore.ts')
-rw-r--r--packages/main/src/stores/MainStore.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/main/src/stores/MainStore.ts b/packages/main/src/stores/MainStore.ts
index 4b85c22..bab03c2 100644
--- a/packages/main/src/stores/MainStore.ts
+++ b/packages/main/src/stores/MainStore.ts
@@ -19,19 +19,19 @@
19 */ 19 */
20 20
21import { applySnapshot, Instance, types } from 'mobx-state-tree'; 21import { applySnapshot, Instance, types } from 'mobx-state-tree';
22import { BrowserViewBounds, emptySharedStore } from '@sophie/shared'; 22import { BrowserViewBounds } from '@sophie/shared';
23 23
24import type { Config } from './Config'; 24import type { Config } from './Config';
25import { sharedStore } from './SharedStore'; 25import { sharedStore } from './SharedStore';
26 26
27export const mainStore = types.model('MainStore', { 27export const mainStore = types.model('MainStore', {
28 browserViewBounds: types.model('BrowserViewBounds', { 28 browserViewBounds: types.optional(types.model('BrowserViewBounds', {
29 x: 0, 29 x: 0,
30 y: 0, 30 y: 0,
31 width: 0, 31 width: 0,
32 height: 0, 32 height: 0,
33 }), 33 }), {}),
34 shared: sharedStore, 34 shared: types.optional(sharedStore, {}),
35}).views((self) => ({ 35}).views((self) => ({
36 get config(): Config { 36 get config(): Config {
37 return self.shared.config; 37 return self.shared.config;
@@ -48,8 +48,5 @@ export const mainStore = types.model('MainStore', {
48export interface MainStore extends Instance<typeof mainStore> {} 48export interface MainStore extends Instance<typeof mainStore> {}
49 49
50export function createMainStore(): MainStore { 50export function createMainStore(): MainStore {
51 return mainStore.create({ 51 return mainStore.create();
52 browserViewBounds: {},
53 shared: emptySharedStore,
54 });
55} 52}