aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/FeaturesStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-01-09 15:39:45 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-01-09 15:39:45 +0100
commit08c40f00de99f2e49f07106c241110f7afa71f6c (patch)
tree12e516faca9fb94cf5beee9cd4396f7d869c75de /src/stores/FeaturesStore.js
parentMerge branch 'feature/basicAuth' into develop (diff)
downloadferdium-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/FeaturesStore.js')
-rw-r--r--src/stores/FeaturesStore.js9
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 @@
1import { computed, observable } from 'mobx'; 1import { computed, observable, reaction } from 'mobx';
2 2
3import Store from './lib/Store'; 3import Store from './lib/Store';
4import CachedRequest from './lib/CachedRequest'; 4import 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() {