diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-18 11:15:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 11:15:25 +0200 |
commit | d4101a48b3eee8b1fb177831aa02a4b4fbec2588 (patch) | |
tree | c92f2fbe91197fde8589207463d0d6526b4ff76b /src/features/workspaces/index.js | |
parent | 5.6.3-nightly.6 [skip ci] (diff) | |
download | ferdium-app-d4101a48b3eee8b1fb177831aa02a4b4fbec2588.tar.gz ferdium-app-d4101a48b3eee8b1fb177831aa02a4b4fbec2588.tar.zst ferdium-app-d4101a48b3eee8b1fb177831aa02a4b4fbec2588.zip |
chore: convert various files from JS to TS (#1959)
Diffstat (limited to 'src/features/workspaces/index.js')
-rw-r--r-- | src/features/workspaces/index.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js deleted file mode 100644 index 83e4d9049..000000000 --- a/src/features/workspaces/index.js +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | import { reaction } from 'mobx'; | ||
2 | import WorkspacesStore from './store'; | ||
3 | import { resetApiRequests } from './api'; | ||
4 | |||
5 | const debug = require('debug')('Ferdi:feature:workspaces'); | ||
6 | |||
7 | export const workspaceStore = new WorkspacesStore(); | ||
8 | |||
9 | export default function initWorkspaces(stores, actions) { | ||
10 | stores.workspaces = workspaceStore; | ||
11 | const { features } = stores; | ||
12 | |||
13 | // Toggle workspace feature | ||
14 | reaction( | ||
15 | () => ( | ||
16 | features.features.isWorkspaceEnabled | ||
17 | ), | ||
18 | (isEnabled) => { | ||
19 | if (isEnabled && !workspaceStore.isFeatureActive) { | ||
20 | debug('Initializing `workspaces` feature'); | ||
21 | workspaceStore.start(stores, actions); | ||
22 | } else if (workspaceStore.isFeatureActive) { | ||
23 | debug('Disabling `workspaces` feature'); | ||
24 | workspaceStore.stop(); | ||
25 | resetApiRequests(); | ||
26 | } | ||
27 | }, | ||
28 | { fireImmediately: true }, | ||
29 | ); | ||
30 | } | ||