diff options
author | 2018-11-24 20:36:09 +0100 | |
---|---|---|
committer | 2018-11-24 20:36:09 +0100 | |
commit | 217cb8cdba811b93394811c6d616267cdf838eee (patch) | |
tree | 3683490e8288dbd179d4d60a09247287191e3b65 /src/stores/FeaturesStore.js | |
parent | Delay app based on featureAPI settings (diff) | |
download | ferdium-app-217cb8cdba811b93394811c6d616267cdf838eee.tar.gz ferdium-app-217cb8cdba811b93394811c6d616267cdf838eee.tar.zst ferdium-app-217cb8cdba811b93394811c6d616267cdf838eee.zip |
Add missing delayApp commit
Diffstat (limited to 'src/stores/FeaturesStore.js')
-rw-r--r-- | src/stores/FeaturesStore.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js index f788c347d..9740d078f 100644 --- a/src/stores/FeaturesStore.js +++ b/src/stores/FeaturesStore.js | |||
@@ -3,15 +3,19 @@ import { computed, observable } from 'mobx'; | |||
3 | import Store from './lib/Store'; | 3 | import Store from './lib/Store'; |
4 | import CachedRequest from './lib/CachedRequest'; | 4 | import CachedRequest from './lib/CachedRequest'; |
5 | 5 | ||
6 | import delayApp from '../features/delayApp'; | ||
7 | |||
6 | export default class FeaturesStore extends Store { | 8 | export default class FeaturesStore extends Store { |
7 | @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); | 9 | @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); |
8 | @observable featuresRequest = new CachedRequest(this.api.features, 'features'); | 10 | @observable featuresRequest = new CachedRequest(this.api.features, 'features'); |
9 | 11 | ||
10 | setup() { | 12 | async setup() { |
11 | this.registerReactions([ | 13 | this.registerReactions([ |
12 | this._monitorLoginStatus.bind(this), | 14 | this._monitorLoginStatus.bind(this), |
13 | this._debugFeatures.bind(this), | ||
14 | ]); | 15 | ]); |
16 | |||
17 | await this.featuresRequest._promise; | ||
18 | setTimeout(this._enableFeatures.bind(this), 1); | ||
15 | } | 19 | } |
16 | 20 | ||
17 | @computed get features() { | 21 | @computed get features() { |
@@ -22,10 +26,6 @@ export default class FeaturesStore extends Store { | |||
22 | return this.defaultFeaturesRequest.execute().result || {}; | 26 | return this.defaultFeaturesRequest.execute().result || {}; |
23 | } | 27 | } |
24 | 28 | ||
25 | _debugFeatures() { | ||
26 | console.log(this.features); | ||
27 | } | ||
28 | |||
29 | _monitorLoginStatus() { | 29 | _monitorLoginStatus() { |
30 | if (this.stores.user.isLoggedIn) { | 30 | if (this.stores.user.isLoggedIn) { |
31 | this.featuresRequest.invalidate({ immediately: true }); | 31 | this.featuresRequest.invalidate({ immediately: true }); |
@@ -33,4 +33,8 @@ export default class FeaturesStore extends Store { | |||
33 | this.defaultFeaturesRequest.invalidate({ immediately: true }); | 33 | this.defaultFeaturesRequest.invalidate({ immediately: true }); |
34 | } | 34 | } |
35 | } | 35 | } |
36 | |||
37 | _enableFeatures() { | ||
38 | delayApp(this.stores, this.actions); | ||
39 | } | ||
36 | } | 40 | } |