aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/workspaces/index.js')
-rw-r--r--src/features/workspaces/index.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/features/workspaces/index.js b/src/features/workspaces/index.js
index b4cfd3c2d..50ac3b414 100644
--- a/src/features/workspaces/index.js
+++ b/src/features/workspaces/index.js
@@ -1,14 +1,11 @@
1import { observable, reaction } from 'mobx'; 1import { reaction } from 'mobx';
2import { merge } from 'lodash';
3import WorkspacesStore from './store'; 2import WorkspacesStore from './store';
4import api from './api'; 3import api from './api';
4import { state, resetState } from './state';
5 5
6const debug = require('debug')('Franz:feature:workspaces'); 6const debug = require('debug')('Franz:feature:workspaces');
7 7
8let store = null; 8let store = null;
9const defaultState = { workspaces: [] };
10
11export const state = observable(defaultState);
12 9
13export default function initWorkspaces(stores, actions) { 10export default function initWorkspaces(stores, actions) {
14 const { features, user } = stores; 11 const { features, user } = stores;
@@ -27,8 +24,7 @@ export default function initWorkspaces(stores, actions) {
27 debug('Disabling `workspaces` feature'); 24 debug('Disabling `workspaces` feature');
28 store.teardown(); 25 store.teardown();
29 store = null; 26 store = null;
30 // Reset state to default 27 resetState(); // Reset state to default
31 merge(state, defaultState);
32 } 28 }
33 }, 29 },
34 { 30 {