aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/src
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-28 01:07:56 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-08 21:43:18 +0100
commit24bbe1f574ee6b0d6d0ebc8c29cbf014fc450584 (patch)
treee89b2d700930d6722eb0685d8d3a9be91df851cf /packages/shared/src
parenttest: Add tests for main window hardening (diff)
downloadsophie-24bbe1f574ee6b0d6d0ebc8c29cbf014fc450584.tar.gz
sophie-24bbe1f574ee6b0d6d0ebc8c29cbf014fc450584.tar.zst
sophie-24bbe1f574ee6b0d6d0ebc8c29cbf014fc450584.zip
feat: Save selected service to file
Sophie start off from the service that was selected when it was last open. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/shared/src')
-rw-r--r--packages/shared/src/stores/GlobalSettings.ts3
-rw-r--r--packages/shared/src/stores/SharedStore.ts1
2 files changed, 3 insertions, 1 deletions
diff --git a/packages/shared/src/stores/GlobalSettings.ts b/packages/shared/src/stores/GlobalSettings.ts
index 1c6d7f3..7a2c334 100644
--- a/packages/shared/src/stores/GlobalSettings.ts
+++ b/packages/shared/src/stores/GlobalSettings.ts
@@ -22,12 +22,15 @@ import { Instance, types, SnapshotIn, SnapshotOut } from 'mobx-state-tree';
22 22
23import { ThemeSource } from '../schemas'; 23import { ThemeSource } from '../schemas';
24 24
25import Service from './Service';
26
25const GlobalSettings = /* @__PURE__ */ (() => 27const GlobalSettings = /* @__PURE__ */ (() =>
26 types.model('GlobalSettings', { 28 types.model('GlobalSettings', {
27 themeSource: types.optional( 29 themeSource: types.optional(
28 types.enumeration(ThemeSource.options), 30 types.enumeration(ThemeSource.options),
29 'system', 31 'system',
30 ), 32 ),
33 selectedService: types.safeReference(Service),
31 }))(); 34 }))();
32 35
33/* 36/*
diff --git a/packages/shared/src/stores/SharedStore.ts b/packages/shared/src/stores/SharedStore.ts
index 4e064c6..d81a3d3 100644
--- a/packages/shared/src/stores/SharedStore.ts
+++ b/packages/shared/src/stores/SharedStore.ts
@@ -37,7 +37,6 @@ const SharedStore = /* @__PURE__ */ (() =>
37 profiles: types.array(types.reference(Profile)), 37 profiles: types.array(types.reference(Profile)),
38 servicesById: types.map(Service), 38 servicesById: types.map(Service),
39 services: types.array(types.reference(Service)), 39 services: types.array(types.reference(Service)),
40 selectedService: types.safeReference(Service),
41 shouldUseDarkColors: false, 40 shouldUseDarkColors: false,
42 }))(); 41 }))();
43 42