diff options
Diffstat (limited to 'src/features/communityRecipes')
-rw-r--r-- | src/features/communityRecipes/index.js | 19 | ||||
-rw-r--r-- | src/features/communityRecipes/store.js | 4 |
2 files changed, 1 insertions, 22 deletions
diff --git a/src/features/communityRecipes/index.js b/src/features/communityRecipes/index.js index 39f7e9cd6..828c6d867 100644 --- a/src/features/communityRecipes/index.js +++ b/src/features/communityRecipes/index.js | |||
@@ -1,26 +1,7 @@ | |||
1 | import { reaction } from 'mobx'; | ||
2 | import { CommunityRecipesStore } from './store'; | 1 | import { CommunityRecipesStore } from './store'; |
3 | 2 | ||
4 | const debug = require('debug')('Ferdi:feature:communityRecipes'); | ||
5 | |||
6 | export const communityRecipesStore = new CommunityRecipesStore(); | 3 | export const communityRecipesStore = new CommunityRecipesStore(); |
7 | 4 | ||
8 | export default function initCommunityRecipes(stores, actions) { | 5 | export default function initCommunityRecipes(stores, actions) { |
9 | const { features } = stores; | ||
10 | |||
11 | communityRecipesStore.start(stores, actions); | 6 | communityRecipesStore.start(stores, actions); |
12 | |||
13 | // Toggle communityRecipe premium status | ||
14 | reaction( | ||
15 | () => ( | ||
16 | features.features.isCommunityRecipesIncludedInCurrentPlan | ||
17 | ), | ||
18 | (isPremiumFeature) => { | ||
19 | debug('Community recipes is premium feature: ', isPremiumFeature); | ||
20 | communityRecipesStore.isCommunityRecipesIncludedInCurrentPlan = true; | ||
21 | }, | ||
22 | { | ||
23 | fireImmediately: true, | ||
24 | }, | ||
25 | ); | ||
26 | } | 7 | } |
diff --git a/src/features/communityRecipes/store.js b/src/features/communityRecipes/store.js index 3a60e5449..acc1e52f6 100644 --- a/src/features/communityRecipes/store.js +++ b/src/features/communityRecipes/store.js | |||
@@ -1,11 +1,9 @@ | |||
1 | import { computed, observable } from 'mobx'; | 1 | import { computed } from 'mobx'; |
2 | import { FeatureStore } from '../utils/FeatureStore'; | 2 | import { FeatureStore } from '../utils/FeatureStore'; |
3 | 3 | ||
4 | const debug = require('debug')('Ferdi:feature:communityRecipes:store'); | 4 | const debug = require('debug')('Ferdi:feature:communityRecipes:store'); |
5 | 5 | ||
6 | export class CommunityRecipesStore extends FeatureStore { | 6 | export class CommunityRecipesStore extends FeatureStore { |
7 | @observable isCommunityRecipesIncludedInCurrentPlan = true; | ||
8 | |||
9 | start(stores, actions) { | 7 | start(stores, actions) { |
10 | debug('start'); | 8 | debug('start'); |
11 | this.stores = stores; | 9 | this.stores = stores; |