diff options
Diffstat (limited to 'packages/main/src/stores/Profile.ts')
-rw-r--r-- | packages/main/src/stores/Profile.ts | 12 |
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 | ||
21 | import { | 21 | import { |
22 | profile as originalProfile, | 22 | Profile as ProfileBase, |
23 | ProfileSettingsSnapshotIn, | 23 | ProfileSettingsSnapshotIn, |
24 | } from '@sophie/shared'; | 24 | } from '@sophie/shared'; |
25 | import { getSnapshot, Instance } from 'mobx-state-tree'; | 25 | import { 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 | ||
33 | export const profile = originalProfile.views((self) => ({ | 33 | const 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 | ||
40 | export 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 | */ | ||
44 | interface Profile extends Instance<typeof Profile> {} | ||
45 | |||
46 | export default Profile; | ||
41 | 47 | ||
42 | export type ProfileSettingsSnapshotWithId = [string, ProfileSettingsSnapshotIn]; | 48 | export type ProfileSettingsSnapshotWithId = [string, ProfileSettingsSnapshotIn]; |
43 | 49 | ||