aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/stores/Profile.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/main/src/stores/Profile.ts')
-rw-r--r--packages/main/src/stores/Profile.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/main/src/stores/Profile.ts b/packages/main/src/stores/Profile.ts
index 5f77fe4..ec2a64b 100644
--- a/packages/main/src/stores/Profile.ts
+++ b/packages/main/src/stores/Profile.ts
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21import { 21import {
22 profile as originalProfile, 22 Profile as ProfileBase,
23 ProfileSettingsSnapshotIn, 23 ProfileSettingsSnapshotIn,
24} from '@sophie/shared'; 24} from '@sophie/shared';
25import { getSnapshot, Instance } from 'mobx-state-tree'; 25import { getSnapshot, Instance } from 'mobx-state-tree';
@@ -30,14 +30,20 @@ export interface ProfileConfig extends ProfileSettingsSnapshotIn {
30 id?: string | undefined; 30 id?: string | undefined;
31} 31}
32 32
33export const profile = originalProfile.views((self) => ({ 33const Profile = ProfileBase.views((self) => ({
34 get config(): ProfileConfig { 34 get config(): ProfileConfig {
35 const { id, settings } = self; 35 const { id, settings } = self;
36 return { ...getSnapshot(settings), id }; 36 return { ...getSnapshot(settings), id };
37 }, 37 },
38})); 38}));
39 39
40export interface Profile extends Instance<typeof profile> {} 40/*
41 eslint-disable-next-line @typescript-eslint/no-redeclare --
42 Intentionally naming the type the same as the store definition.
43*/
44interface Profile extends Instance<typeof Profile> {}
45
46export default Profile;
41 47
42export type ProfileSettingsSnapshotWithId = [string, ProfileSettingsSnapshotIn]; 48export type ProfileSettingsSnapshotWithId = [string, ProfileSettingsSnapshotIn];
43 49