aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/stores/Service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/main/src/stores/Service.ts')
-rw-r--r--packages/main/src/stores/Service.ts16
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
21import type { UnreadCount } from '@sophie/service-shared'; 21import type { UnreadCount } from '@sophie/service-shared';
22import { service as originalService } from '@sophie/shared'; 22import { Service as ServiceBase } from '@sophie/shared';
23import { Instance, getSnapshot, ReferenceIdentifier } from 'mobx-state-tree'; 23import { Instance, getSnapshot, ReferenceIdentifier } from 'mobx-state-tree';
24 24
25import generateId from '../utils/generateId'; 25import generateId from '../utils/generateId';
26import overrideProps from '../utils/overrideProps'; 26import overrideProps from '../utils/overrideProps';
27 27
28import { ProfileSettingsSnapshotWithId } from './Profile'; 28import { ProfileSettingsSnapshotWithId } from './Profile';
29import { serviceSettings, ServiceSettingsSnapshotIn } from './ServiceSettings'; 29import ServiceSettings, { ServiceSettingsSnapshotIn } from './ServiceSettings';
30 30
31export interface ServiceConfig 31export 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
38export const service = overrideProps(originalService, { 38const 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
86export 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*/
90interface Service extends Instance<typeof Service> {}
91
92export default Service;
87 93
88export type ServiceSettingsSnapshotWithId = [string, ServiceSettingsSnapshotIn]; 94export type ServiceSettingsSnapshotWithId = [string, ServiceSettingsSnapshotIn];
89 95