diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-01 14:34:39 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-01 14:34:39 +0100 |
commit | 035dc1bbb1951bfe99740009f8b999c65861d133 (patch) | |
tree | 4e987938d7a25c08ea64f2692d5ae9f0b8bd80fe /src/stores | |
parent | Show service dark mode option only for dark mode services (diff) | |
download | ferdium-app-035dc1bbb1951bfe99740009f8b999c65861d133.tar.gz ferdium-app-035dc1bbb1951bfe99740009f8b999c65861d133.tar.zst ferdium-app-035dc1bbb1951bfe99740009f8b999c65861d133.zip |
Move default feature config to config.js
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/FeaturesStore.js | 6 | ||||
-rw-r--r-- | src/stores/UserStore.js | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js index 59abeb218..9480e27ab 100644 --- a/src/stores/FeaturesStore.js +++ b/src/stores/FeaturesStore.js | |||
@@ -7,6 +7,8 @@ import delayApp from '../features/delayApp'; | |||
7 | import spellchecker from '../features/spellchecker'; | 7 | import spellchecker from '../features/spellchecker'; |
8 | import serviceProxy from '../features/serviceProxy'; | 8 | import serviceProxy from '../features/serviceProxy'; |
9 | 9 | ||
10 | import { DEFAULT_FEATURES_CONFIG } from '../config'; | ||
11 | |||
10 | export default class FeaturesStore extends Store { | 12 | export default class FeaturesStore extends Store { |
11 | @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); | 13 | @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); |
12 | @observable featuresRequest = new CachedRequest(this.api.features, 'features'); | 14 | @observable featuresRequest = new CachedRequest(this.api.features, 'features'); |
@@ -22,10 +24,10 @@ export default class FeaturesStore extends Store { | |||
22 | 24 | ||
23 | @computed get features() { | 25 | @computed get features() { |
24 | if (this.stores.user.isLoggedIn) { | 26 | if (this.stores.user.isLoggedIn) { |
25 | return this.featuresRequest.execute().result || {}; | 27 | return this.featuresRequest.execute().result || DEFAULT_FEATURES_CONFIG; |
26 | } | 28 | } |
27 | 29 | ||
28 | return this.defaultFeaturesRequest.execute().result || {}; | 30 | return this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG; |
29 | } | 31 | } |
30 | 32 | ||
31 | _monitorLoginStatus() { | 33 | _monitorLoginStatus() { |
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 9d8ac5657..d1e6d6570 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -122,13 +122,13 @@ export default class UserStore extends Store { | |||
122 | } | 122 | } |
123 | 123 | ||
124 | @computed get data() { | 124 | @computed get data() { |
125 | this.getUserInfoRequest.execute(); | 125 | if (!this.isLoggedIn) return {}; |
126 | return this.getUserInfoRequest.result || {}; | 126 | |
127 | return this.getUserInfoRequest.execute().result || {}; | ||
127 | } | 128 | } |
128 | 129 | ||
129 | @computed get legacyServices() { | 130 | @computed get legacyServices() { |
130 | this.getLegacyServicesRequest.execute(); | 131 | return this.getLegacyServicesRequest.execute() || {}; |
131 | return this.getLegacyServicesRequest.result || []; | ||
132 | } | 132 | } |
133 | 133 | ||
134 | // Actions | 134 | // Actions |