aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/FeaturesStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/FeaturesStore.js')
-rw-r--r--src/stores/FeaturesStore.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
index 0dff2fda2..1d50dd714 100644
--- a/src/stores/FeaturesStore.js
+++ b/src/stores/FeaturesStore.js
@@ -1,8 +1,4 @@
1import { 1import { computed, observable, runInAction } from 'mobx';
2 computed,
3 observable,
4 runInAction,
5} from 'mobx';
6 2
7import Store from './lib/Store'; 3import Store from './lib/Store';
8import CachedRequest from './lib/CachedRequest'; 4import CachedRequest from './lib/CachedRequest';
@@ -13,7 +9,6 @@ import workspaces from '../features/workspaces';
13import quickSwitch from '../features/quickSwitch'; 9import quickSwitch from '../features/quickSwitch';
14import nightlyBuilds from '../features/nightlyBuilds'; 10import nightlyBuilds from '../features/nightlyBuilds';
15import publishDebugInfo from '../features/publishDebugInfo'; 11import publishDebugInfo from '../features/publishDebugInfo';
16import announcements from '../features/announcements';
17import settingsWS from '../features/settingsWS'; 12import settingsWS from '../features/settingsWS';
18import communityRecipes from '../features/communityRecipes'; 13import communityRecipes from '../features/communityRecipes';
19import todos from '../features/todos'; 14import todos from '../features/todos';
@@ -22,11 +17,17 @@ import appearance from '../features/appearance';
22import { DEFAULT_FEATURES_CONFIG } from '../config'; 17import { DEFAULT_FEATURES_CONFIG } from '../config';
23 18
24export default class FeaturesStore extends Store { 19export default class FeaturesStore extends Store {
25 @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); 20 @observable defaultFeaturesRequest = new CachedRequest(
21 this.api.features,
22 'default',
23 );
26 24
27 @observable featuresRequest = new CachedRequest(this.api.features, 'features'); 25 @observable featuresRequest = new CachedRequest(
26 this.api.features,
27 'features',
28 );
28 29
29 @observable features = ({ ...DEFAULT_FEATURES_CONFIG }); 30 @observable features = { ...DEFAULT_FEATURES_CONFIG };
30 31
31 async setup() { 32 async setup() {
32 this.registerReactions([ 33 this.registerReactions([
@@ -39,7 +40,9 @@ export default class FeaturesStore extends Store {
39 } 40 }
40 41
41 @computed get anonymousFeatures() { 42 @computed get anonymousFeatures() {
42 return this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG; 43 return (
44 this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG
45 );
43 } 46 }
44 47
45 _updateFeatures = () => { 48 _updateFeatures = () => {
@@ -72,7 +75,6 @@ export default class FeaturesStore extends Store {
72 quickSwitch(this.stores, this.actions); 75 quickSwitch(this.stores, this.actions);
73 nightlyBuilds(this.stores, this.actions); 76 nightlyBuilds(this.stores, this.actions);
74 publishDebugInfo(this.stores, this.actions); 77 publishDebugInfo(this.stores, this.actions);
75 announcements(this.stores, this.actions);
76 settingsWS(this.stores, this.actions); 78 settingsWS(this.stores, this.actions);
77 communityRecipes(this.stores, this.actions); 79 communityRecipes(this.stores, this.actions);
78 todos(this.stores, this.actions); 80 todos(this.stores, this.actions);