aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/communityRecipes/store.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-05-02 11:27:23 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-05-02 11:27:23 +0200
commitfbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e (patch)
treedfa0a6c32ce62c605bcdbf5538d9dc03725d1f88 /src/features/communityRecipes/store.js
parentUpdate CHANGELOG.md (diff)
downloadferdium-app-fbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e.tar.gz
ferdium-app-fbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e.tar.zst
ferdium-app-fbff4ed90b0137088b1bb92e95f32fc1bfa7bb3e.zip
Add custom recipe limitation
Diffstat (limited to 'src/features/communityRecipes/store.js')
-rw-r--r--src/features/communityRecipes/store.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/features/communityRecipes/store.js b/src/features/communityRecipes/store.js
new file mode 100644
index 000000000..165b753e8
--- /dev/null
+++ b/src/features/communityRecipes/store.js
@@ -0,0 +1,31 @@
1import { computed, observable } from 'mobx';
2import { FeatureStore } from '../utils/FeatureStore';
3
4const debug = require('debug')('Franz:feature:communityRecipes:store');
5
6export class CommunityRecipesStore extends FeatureStore {
7 @observable isCommunityRecipesPremiumFeature = false;
8
9 start(stores, actions) {
10 debug('start');
11 this.stores = stores;
12 this.actions = actions;
13 }
14
15 stop() {
16 debug('stop');
17 super.stop();
18 }
19
20 @computed get communityRecipes() {
21 if (!this.stores) return [];
22
23 return this.stores.recipePreviews.dev.map((r) => {
24 r.isDevRecipe = !!r.author.find(a => a.email === this.stores.user.data.email);
25
26 return r;
27 });
28 }
29}
30
31export default CommunityRecipesStore;