diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-01-09 15:39:45 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-01-09 15:39:45 +0100 |
commit | 08c40f00de99f2e49f07106c241110f7afa71f6c (patch) | |
tree | 12e516faca9fb94cf5beee9cd4396f7d869c75de /src/stores | |
parent | Merge branch 'feature/basicAuth' into develop (diff) | |
download | ferdium-app-08c40f00de99f2e49f07106c241110f7afa71f6c.tar.gz ferdium-app-08c40f00de99f2e49f07106c241110f7afa71f6c.tar.zst ferdium-app-08c40f00de99f2e49f07106c241110f7afa71f6c.zip |
fix(App): Fix app delay for Premium Supporters
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/FeaturesStore.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js index 2eccf87ee..0adee6adf 100644 --- a/src/stores/FeaturesStore.js +++ b/src/stores/FeaturesStore.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import { computed, observable } from 'mobx'; | 1 | import { computed, observable, reaction } from 'mobx'; |
2 | 2 | ||
3 | import Store from './lib/Store'; | 3 | import Store from './lib/Store'; |
4 | import CachedRequest from './lib/CachedRequest'; | 4 | import CachedRequest from './lib/CachedRequest'; |
@@ -22,6 +22,13 @@ export default class FeaturesStore extends Store { | |||
22 | 22 | ||
23 | await this.featuresRequest._promise; | 23 | await this.featuresRequest._promise; |
24 | setTimeout(this._enableFeatures.bind(this), 1); | 24 | setTimeout(this._enableFeatures.bind(this), 1); |
25 | |||
26 | // single key reaction | ||
27 | reaction(() => this.stores.user.data.isPremium, () => { | ||
28 | if (this.stores.user.isLoggedIn) { | ||
29 | this.featuresRequest.invalidate({ immediately: true }); | ||
30 | } | ||
31 | }); | ||
25 | } | 32 | } |
26 | 33 | ||
27 | @computed get anonymousFeatures() { | 34 | @computed get anonymousFeatures() { |