aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/store.js
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-10 16:12:38 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-10 16:12:38 +0200
commit073212bf046b9218f9e3129988b1b63fba5d685d (patch)
treeb6c4c2db33f3a111a82e7801073bb5b697f9a56c /src/features/workspaces/store.js
parentimprove contrast of workspace switching indicator (diff)
downloadferdium-app-073212bf046b9218f9e3129988b1b63fba5d685d.tar.gz
ferdium-app-073212bf046b9218f9e3129988b1b63fba5d685d.tar.zst
ferdium-app-073212bf046b9218f9e3129988b1b63fba5d685d.zip
added generic pro badge component for settings nav
Diffstat (limited to 'src/features/workspaces/store.js')
-rw-r--r--src/features/workspaces/store.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js
index 2e1764f99..ba48022c2 100644
--- a/src/features/workspaces/store.js
+++ b/src/features/workspaces/store.js
@@ -36,6 +36,8 @@ export default class WorkspacesStore extends FeatureStore {
36 36
37 @observable isWorkspaceDrawerOpen = false; 37 @observable isWorkspaceDrawerOpen = false;
38 38
39 @observable isSettingsRouteActive = null;
40
39 @computed get workspaces() { 41 @computed get workspaces() {
40 if (!this.isFeatureActive) return []; 42 if (!this.isFeatureActive) return [];
41 return getUserWorkspacesRequest.result || []; 43 return getUserWorkspacesRequest.result || [];
@@ -104,8 +106,6 @@ export default class WorkspacesStore extends FeatureStore {
104 106
105 _wasDrawerOpenBeforeSettingsRoute = null; 107 _wasDrawerOpenBeforeSettingsRoute = null;
106 108
107 _isSettingsRouteActive = null;
108
109 _getWorkspaceById = id => this.workspaces.find(w => w.id === id); 109 _getWorkspaceById = id => this.workspaces.find(w => w.id === id);
110 110
111 _updateSettings = (changes) => { 111 _updateSettings = (changes) => {
@@ -239,17 +239,17 @@ export default class WorkspacesStore extends FeatureStore {
239 _openDrawerWithSettingsReaction = () => { 239 _openDrawerWithSettingsReaction = () => {
240 const { router } = this.stores; 240 const { router } = this.stores;
241 const isWorkspaceSettingsRoute = router.location.pathname.includes(WORKSPACES_ROUTES.ROOT); 241 const isWorkspaceSettingsRoute = router.location.pathname.includes(WORKSPACES_ROUTES.ROOT);
242 const isSwitchingToSettingsRoute = !this._isSettingsRouteActive && isWorkspaceSettingsRoute; 242 const isSwitchingToSettingsRoute = !this.isSettingsRouteActive && isWorkspaceSettingsRoute;
243 const isLeavingSettingsRoute = !isWorkspaceSettingsRoute && this._isSettingsRouteActive; 243 const isLeavingSettingsRoute = !isWorkspaceSettingsRoute && this.isSettingsRouteActive;
244 244
245 if (isSwitchingToSettingsRoute) { 245 if (isSwitchingToSettingsRoute) {
246 this._isSettingsRouteActive = true; 246 this.isSettingsRouteActive = true;
247 this._wasDrawerOpenBeforeSettingsRoute = this.isWorkspaceDrawerOpen; 247 this._wasDrawerOpenBeforeSettingsRoute = this.isWorkspaceDrawerOpen;
248 if (!this._wasDrawerOpenBeforeSettingsRoute) { 248 if (!this._wasDrawerOpenBeforeSettingsRoute) {
249 workspaceActions.toggleWorkspaceDrawer(); 249 workspaceActions.toggleWorkspaceDrawer();
250 } 250 }
251 } else if (isLeavingSettingsRoute) { 251 } else if (isLeavingSettingsRoute) {
252 this._isSettingsRouteActive = false; 252 this.isSettingsRouteActive = false;
253 if (!this._wasDrawerOpenBeforeSettingsRoute && this.isWorkspaceDrawerOpen) { 253 if (!this._wasDrawerOpenBeforeSettingsRoute && this.isWorkspaceDrawerOpen) {
254 workspaceActions.toggleWorkspaceDrawer(); 254 workspaceActions.toggleWorkspaceDrawer();
255 } 255 }