aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/stores/GlobalSettings.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-27 00:17:22 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-08 21:43:17 +0100
commit9546dc2aa39ab096ccc723786e718a739d0bdaf9 (patch)
tree9c3afc6155cc59f6dd1235397230aaa15a5f8cec /packages/main/src/stores/GlobalSettings.ts
parentrefactor: Apply shared store patches in batches (diff)
downloadsophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.tar.gz
sophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.tar.zst
sophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.zip
refactor: Coding conventions
Make sure that files have a default import with the same name as the file whenever possible to reduce surprise. Also shuffles around some file names for better legibility. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main/src/stores/GlobalSettings.ts')
-rw-r--r--packages/main/src/stores/GlobalSettings.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/main/src/stores/GlobalSettings.ts b/packages/main/src/stores/GlobalSettings.ts
index 1eb13b3..0a54aa3 100644
--- a/packages/main/src/stores/GlobalSettings.ts
+++ b/packages/main/src/stores/GlobalSettings.ts
@@ -19,18 +19,24 @@
19 */ 19 */
20 20
21import { 21import {
22 globalSettings as originalGlobalSettings, 22 GlobalSettings as GlobalSettingsBase,
23 ThemeSource, 23 ThemeSource,
24} from '@sophie/shared'; 24} from '@sophie/shared';
25import { Instance } from 'mobx-state-tree'; 25import { Instance } from 'mobx-state-tree';
26 26
27export const globalSettings = originalGlobalSettings.actions((self) => ({ 27const GlobalSettings = GlobalSettingsBase.actions((self) => ({
28 setThemeSource(mode: ThemeSource): void { 28 setThemeSource(mode: ThemeSource): void {
29 self.themeSource = mode; 29 self.themeSource = mode;
30 }, 30 },
31})); 31}));
32 32
33export interface GlobalSettings extends Instance<typeof globalSettings> {} 33/*
34 eslint-disable-next-line @typescript-eslint/no-redeclare --
35 Intentionally naming the type the same as the store definition.
36*/
37interface GlobalSettings extends Instance<typeof GlobalSettings> {}
38
39export default GlobalSettings;
34 40
35export type { 41export type {
36 GlobalSettingsSnapshotIn, 42 GlobalSettingsSnapshotIn,