aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/src/stores/SharedStoreBase.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/shared/src/stores/SharedStoreBase.ts')
-rw-r--r--packages/shared/src/stores/SharedStoreBase.ts24
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/shared/src/stores/SharedStoreBase.ts b/packages/shared/src/stores/SharedStoreBase.ts
index 4526c95..786dc5f 100644
--- a/packages/shared/src/stores/SharedStoreBase.ts
+++ b/packages/shared/src/stores/SharedStoreBase.ts
@@ -19,12 +19,12 @@
19 */ 19 */
20 20
21import { 21import {
22 IJsonPatch, 22 type IJsonPatch,
23 Instance, 23 type Instance,
24 types, 24 types,
25 SnapshotIn, 25 type SnapshotIn,
26 SnapshotOut, 26 type SnapshotOut,
27 IAnyModelType, 27 type IAnyModelType,
28} from 'mobx-state-tree'; 28} from 'mobx-state-tree';
29 29
30import GlobalSettingsBase from './GlobalSettingsBase.js'; 30import GlobalSettingsBase from './GlobalSettingsBase.js';
@@ -51,6 +51,10 @@ export function defineSharedStoreModel<
51 writingDirection: types.optional(WritingDirection, 'ltr'), 51 writingDirection: types.optional(WritingDirection, 'ltr'),
52 }) 52 })
53 .views((self) => ({ 53 .views((self) => ({
54 get alwaysHideLocationBar(): boolean {
55 const settings = self.settings as GlobalSettingsBase;
56 return settings.selectedService === undefined;
57 },
54 get alwaysShowLocationBar(): boolean { 58 get alwaysShowLocationBar(): boolean {
55 const settings = self.settings as GlobalSettingsBase; 59 const settings = self.settings as GlobalSettingsBase;
56 const selectedService = settings.selectedService as 60 const selectedService = settings.selectedService as
@@ -62,14 +66,14 @@ export function defineSharedStoreModel<
62 .views((self) => ({ 66 .views((self) => ({
63 get locationBarVisible(): boolean { 67 get locationBarVisible(): boolean {
64 const settings = self.settings as GlobalSettingsBase; 68 const settings = self.settings as GlobalSettingsBase;
65 return settings.showLocationBar || self.alwaysShowLocationBar;
66 },
67 get canToggleLocationBar(): boolean {
68 return ( 69 return (
69 !self.alwaysShowLocationBar && 70 !self.alwaysHideLocationBar &&
70 self.settings.selectedService !== undefined 71 (self.alwaysShowLocationBar || settings.showLocationBar)
71 ); 72 );
72 }, 73 },
74 get canToggleLocationBar(): boolean {
75 return !(self.alwaysHideLocationBar || self.alwaysShowLocationBar);
76 },
73 })); 77 }));
74} 78}
75 79