diff options
Diffstat (limited to 'packages/shared/src')
-rw-r--r-- | packages/shared/src/schemas.ts | 6 | ||||
-rw-r--r-- | packages/shared/src/stores/SharedStore.ts | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/packages/shared/src/schemas.ts b/packages/shared/src/schemas.ts index 2f108bd..7fb9717 100644 --- a/packages/shared/src/schemas.ts +++ b/packages/shared/src/schemas.ts | |||
@@ -20,6 +20,11 @@ | |||
20 | 20 | ||
21 | import { z } from 'zod'; | 21 | import { z } from 'zod'; |
22 | 22 | ||
23 | const setSelectedServiceId = z.object({ | ||
24 | action: z.literal('set-selected-service-id'), | ||
25 | serviceId: z.string(), | ||
26 | }); | ||
27 | |||
23 | export const browserViewBounds = z.object({ | 28 | export const browserViewBounds = z.object({ |
24 | x: z.number().int().nonnegative(), | 29 | x: z.number().int().nonnegative(), |
25 | y: z.number().int().nonnegative(), | 30 | y: z.number().int().nonnegative(), |
@@ -48,6 +53,7 @@ const reloadAllServicesAction = z.object({ | |||
48 | }); | 53 | }); |
49 | 54 | ||
50 | export const action = z.union([ | 55 | export const action = z.union([ |
56 | setSelectedServiceId, | ||
51 | setBrowserViewBoundsAction, | 57 | setBrowserViewBoundsAction, |
52 | setThemeSourceAction, | 58 | setThemeSourceAction, |
53 | reloadAllServicesAction, | 59 | reloadAllServicesAction, |
diff --git a/packages/shared/src/stores/SharedStore.ts b/packages/shared/src/stores/SharedStore.ts index ffa387f..e6e2cad 100644 --- a/packages/shared/src/stores/SharedStore.ts +++ b/packages/shared/src/stores/SharedStore.ts | |||
@@ -28,11 +28,13 @@ import { | |||
28 | 28 | ||
29 | import { config } from './Config'; | 29 | import { config } from './Config'; |
30 | import { runtimeService } from './RuntimeService'; | 30 | import { runtimeService } from './RuntimeService'; |
31 | import { service } from './Service'; | ||
31 | 32 | ||
32 | export const sharedStore = types.model('SharedStore', { | 33 | export const sharedStore = types.model('SharedStore', { |
33 | config: types.optional(config, {}), | 34 | config: types.optional(config, {}), |
34 | shouldUseDarkColors: false, | ||
35 | runtimeServices: types.map(runtimeService), | 35 | runtimeServices: types.map(runtimeService), |
36 | selectedService: types.safeReference(service), | ||
37 | shouldUseDarkColors: false, | ||
36 | }); | 38 | }); |
37 | 39 | ||
38 | export interface SharedStore extends Instance<typeof sharedStore> {} | 40 | export interface SharedStore extends Instance<typeof sharedStore> {} |