diff options
Diffstat (limited to 'packages/main/src/stores/Service.ts')
-rw-r--r-- | packages/main/src/stores/Service.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/main/src/stores/Service.ts b/packages/main/src/stores/Service.ts index 331805b..e70caa6 100644 --- a/packages/main/src/stores/Service.ts +++ b/packages/main/src/stores/Service.ts | |||
@@ -19,14 +19,14 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | import type { UnreadCount } from '@sophie/service-shared'; | 21 | import type { UnreadCount } from '@sophie/service-shared'; |
22 | import { service as originalService } from '@sophie/shared'; | 22 | import { Service as ServiceBase } from '@sophie/shared'; |
23 | import { Instance, getSnapshot, ReferenceIdentifier } from 'mobx-state-tree'; | 23 | import { Instance, getSnapshot, ReferenceIdentifier } from 'mobx-state-tree'; |
24 | 24 | ||
25 | import generateId from '../utils/generateId'; | 25 | import generateId from '../utils/generateId'; |
26 | import overrideProps from '../utils/overrideProps'; | 26 | import overrideProps from '../utils/overrideProps'; |
27 | 27 | ||
28 | import { ProfileSettingsSnapshotWithId } from './Profile'; | 28 | import { ProfileSettingsSnapshotWithId } from './Profile'; |
29 | import { serviceSettings, ServiceSettingsSnapshotIn } from './ServiceSettings'; | 29 | import ServiceSettings, { ServiceSettingsSnapshotIn } from './ServiceSettings'; |
30 | 30 | ||
31 | export interface ServiceConfig | 31 | export interface ServiceConfig |
32 | extends Omit<ServiceSettingsSnapshotIn, 'profile'> { | 32 | extends Omit<ServiceSettingsSnapshotIn, 'profile'> { |
@@ -35,8 +35,8 @@ export interface ServiceConfig | |||
35 | profile?: ReferenceIdentifier | undefined; | 35 | profile?: ReferenceIdentifier | undefined; |
36 | } | 36 | } |
37 | 37 | ||
38 | export const service = overrideProps(originalService, { | 38 | const Service = overrideProps(ServiceBase, { |
39 | settings: serviceSettings, | 39 | settings: ServiceSettings, |
40 | }) | 40 | }) |
41 | .views((self) => ({ | 41 | .views((self) => ({ |
42 | get config(): ServiceConfig { | 42 | get config(): ServiceConfig { |
@@ -83,7 +83,13 @@ export const service = overrideProps(originalService, { | |||
83 | }, | 83 | }, |
84 | })); | 84 | })); |
85 | 85 | ||
86 | export interface Service extends Instance<typeof service> {} | 86 | /* |
87 | eslint-disable-next-line @typescript-eslint/no-redeclare -- | ||
88 | Intentionally naming the type the same as the store definition. | ||
89 | */ | ||
90 | interface Service extends Instance<typeof Service> {} | ||
91 | |||
92 | export default Service; | ||
87 | 93 | ||
88 | export type ServiceSettingsSnapshotWithId = [string, ServiceSettingsSnapshotIn]; | 94 | export type ServiceSettingsSnapshotWithId = [string, ServiceSettingsSnapshotIn]; |
89 | 95 | ||