diff options
Diffstat (limited to 'packages/main/src/stores/SharedStore.ts')
-rw-r--r-- | packages/main/src/stores/SharedStore.ts | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/packages/main/src/stores/SharedStore.ts b/packages/main/src/stores/SharedStore.ts index 182b693..d72c532 100644 --- a/packages/main/src/stores/SharedStore.ts +++ b/packages/main/src/stores/SharedStore.ts | |||
@@ -18,10 +18,8 @@ | |||
18 | * SPDX-License-Identifier: AGPL-3.0-only | 18 | * SPDX-License-Identifier: AGPL-3.0-only |
19 | */ | 19 | */ |
20 | 20 | ||
21 | import { SharedStore as SharedStoreBase } from '@sophie/shared'; | 21 | import { defineSharedStoreModel } from '@sophie/shared'; |
22 | import { getSnapshot, Instance, types } from 'mobx-state-tree'; | 22 | import { getSnapshot, Instance } from 'mobx-state-tree'; |
23 | |||
24 | import overrideProps from '../utils/overrideProps'; | ||
25 | 23 | ||
26 | import GlobalSettings from './GlobalSettings'; | 24 | import GlobalSettings from './GlobalSettings'; |
27 | import Profile from './Profile'; | 25 | import Profile from './Profile'; |
@@ -33,13 +31,7 @@ function getConfigs<T>(models: { config: T }[]): T[] | undefined { | |||
33 | return models.length === 0 ? undefined : models.map((model) => model.config); | 31 | return models.length === 0 ? undefined : models.map((model) => model.config); |
34 | } | 32 | } |
35 | 33 | ||
36 | const SharedStore = overrideProps(SharedStoreBase, { | 34 | const SharedStore = defineSharedStoreModel(GlobalSettings, Profile, Service) |
37 | settings: types.optional(GlobalSettings, {}), | ||
38 | profilesById: types.map(Profile), | ||
39 | profiles: types.array(types.reference(Profile)), | ||
40 | servicesById: types.map(Service), | ||
41 | services: types.array(types.reference(Service)), | ||
42 | }) | ||
43 | .views((self) => ({ | 35 | .views((self) => ({ |
44 | get config(): Config { | 36 | get config(): Config { |
45 | const { settings, profiles, services } = self; | 37 | const { settings, profiles, services } = self; |