aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/stores/SharedStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/main/src/stores/SharedStore.ts')
-rw-r--r--packages/main/src/stores/SharedStore.ts14
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
21import { SharedStore as SharedStoreBase } from '@sophie/shared'; 21import { defineSharedStoreModel } from '@sophie/shared';
22import { getSnapshot, Instance, types } from 'mobx-state-tree'; 22import { getSnapshot, Instance } from 'mobx-state-tree';
23
24import overrideProps from '../utils/overrideProps';
25 23
26import GlobalSettings from './GlobalSettings'; 24import GlobalSettings from './GlobalSettings';
27import Profile from './Profile'; 25import 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
36const SharedStore = overrideProps(SharedStoreBase, { 34const 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;