diff options
author | 2021-10-26 21:18:20 +0530 | |
---|---|---|
committer | 2021-10-26 21:18:20 +0530 | |
commit | 91c69428ed0dc2dd26b00c6dd5a6684f25515a34 (patch) | |
tree | 062a9a4946aa1367263533682ee59e795ea97234 /src/features/workspaces/index.ts | |
parent | Add feature to display service name under service icon when the toggle for it... (diff) | |
download | ferdium-app-91c69428ed0dc2dd26b00c6dd5a6684f25515a34.tar.gz ferdium-app-91c69428ed0dc2dd26b00c6dd5a6684f25515a34.tar.zst ferdium-app-91c69428ed0dc2dd26b00c6dd5a6684f25515a34.zip |
Cleanup/remove feature toggle for todo, workspace, service proxy (#2134)
* Remove DEFAULT_FEATURES_CONFIG from config
* Remove static controller
Co-authored-by: Madhuri B <MadhuriBandanadam@users.noreply.github.com>
Diffstat (limited to 'src/features/workspaces/index.ts')
-rw-r--r-- | src/features/workspaces/index.ts | 22 |
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 @@ | |||
1 | import { reaction } from 'mobx'; | ||
2 | import WorkspacesStore from './store'; | 1 | import WorkspacesStore from './store'; |
3 | import { resetApiRequests } from './api'; | ||
4 | |||
5 | const debug = require('debug')('Ferdi:feature:workspaces'); | ||
6 | 2 | ||
7 | export const workspaceStore = new WorkspacesStore(); | 3 | export const workspaceStore = new WorkspacesStore(); |
8 | 4 | ||
9 | export default function initWorkspaces(stores, actions) { | 5 | export 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 | } |