aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/index.ts
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-27 07:25:26 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-27 07:25:26 +0530
commit477bdd76a7405ff10a5cfabdec00ee9ae02f2698 (patch)
treebfa8cfb70e6852b9f535ccfd9b05712269a70dc1 /src/features/workspaces/index.ts
parentBumped up ferdi beta version to '5.6.3-beta.2' (diff)
parent5.6.3-nightly.44 [skip ci] (diff)
downloadferdium-app-477bdd76a7405ff10a5cfabdec00ee9ae02f2698.tar.gz
ferdium-app-477bdd76a7405ff10a5cfabdec00ee9ae02f2698.tar.zst
ferdium-app-477bdd76a7405ff10a5cfabdec00ee9ae02f2698.zip
Merge branch 'nightly' into release
Diffstat (limited to 'src/features/workspaces/index.ts')
-rw-r--r--src/features/workspaces/index.ts22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/features/workspaces/index.ts b/src/features/workspaces/index.ts
index ecca64b41..25975936a 100644
--- a/src/features/workspaces/index.ts
+++ b/src/features/workspaces/index.ts
@@ -1,28 +1,8 @@
1import { reaction } from 'mobx';
2import WorkspacesStore from './store'; 1import WorkspacesStore from './store';
3import { resetApiRequests } from './api';
4
5const debug = require('debug')('Ferdi:feature:workspaces');
6 2
7export const workspaceStore = new WorkspacesStore(); 3export const workspaceStore = new WorkspacesStore();
8 4
9export default function initWorkspaces(stores, actions) { 5export default function initWorkspaces(stores, actions) {
10 stores.workspaces = workspaceStore; 6 stores.workspaces = workspaceStore;
11 const { features } = stores; 7 workspaceStore.start(stores, actions);
12
13 // Toggle workspace feature
14 reaction(
15 () => features.features.isWorkspaceEnabled,
16 isEnabled => {
17 if (isEnabled && !workspaceStore.isFeatureActive) {
18 debug('Initializing `workspaces` feature');
19 workspaceStore.start(stores, actions);
20 } else if (workspaceStore.isFeatureActive) {
21 debug('Disabling `workspaces` feature');
22 workspaceStore.stop();
23 resetApiRequests();
24 }
25 },
26 { fireImmediately: true },
27 );
28} 8}