diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-01-28 01:07:56 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-02-08 21:43:18 +0100 |
commit | 24bbe1f574ee6b0d6d0ebc8c29cbf014fc450584 (patch) | |
tree | e89b2d700930d6722eb0685d8d3a9be91df851cf /packages/shared | |
parent | test: Add tests for main window hardening (diff) | |
download | sophie-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')
-rw-r--r-- | packages/shared/src/stores/GlobalSettings.ts | 3 | ||||
-rw-r--r-- | packages/shared/src/stores/SharedStore.ts | 1 |
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 | ||
23 | import { ThemeSource } from '../schemas'; | 23 | import { ThemeSource } from '../schemas'; |
24 | 24 | ||
25 | import Service from './Service'; | ||
26 | |||
25 | const GlobalSettings = /* @__PURE__ */ (() => | 27 | const 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 | ||