From ede3747a1d5ef1dd9a6d74ba9600ca4f9bc452ed Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sun, 26 Dec 2021 00:27:39 +0100 Subject: refactor: Simplify browserViewBounds handling --- packages/main/src/stores/RootStore.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/main/src/stores/RootStore.ts') diff --git a/packages/main/src/stores/RootStore.ts b/packages/main/src/stores/RootStore.ts index 9d138ce..c09cd4a 100644 --- a/packages/main/src/stores/RootStore.ts +++ b/packages/main/src/stores/RootStore.ts @@ -27,10 +27,16 @@ import { } from '@sophie/shared'; export const rootStore = types.model('RootStore', { + browserViewBounds: types.model("BrowserViewBoundsStore", { + x: 0, + y: 0, + width: 0, + height: 0, + }), shared: sharedStore, }).actions((self) => ({ setBrowserViewBounds(bounds: BrowserViewBounds) { - applySnapshot(self.shared.browserViewBounds, bounds); + applySnapshot(self.browserViewBounds, bounds); }, setPaletteMode(mode: PaletteMode) { self.shared.shouldUseDarkColors = mode === 'dark'; @@ -41,6 +47,7 @@ export interface RootStore extends Instance {} export function createRootStore(): RootStore { return rootStore.create({ + browserViewBounds: {}, shared: emptySharedStore, }); } -- cgit v1.2.3-70-g09d2