aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/communityRecipes
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/communityRecipes')
-rw-r--r--src/features/communityRecipes/store.ts (renamed from src/features/communityRecipes/store.js)23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/features/communityRecipes/store.js b/src/features/communityRecipes/store.ts
index 05e18e2f7..a8d358ba0 100644
--- a/src/features/communityRecipes/store.js
+++ b/src/features/communityRecipes/store.ts
@@ -4,7 +4,11 @@ import { FeatureStore } from '../utils/FeatureStore';
4const debug = require('debug')('Ferdi:feature:communityRecipes:store'); 4const debug = require('debug')('Ferdi:feature:communityRecipes:store');
5 5
6export class CommunityRecipesStore extends FeatureStore { 6export class CommunityRecipesStore extends FeatureStore {
7 start(stores, actions) { 7 stores: any;
8
9 actions: any;
10
11 start(stores: any, actions: any) {
8 debug('start'); 12 debug('start');
9 this.stores = stores; 13 this.stores = stores;
10 this.actions = actions; 14 this.actions = actions;
@@ -18,14 +22,17 @@ export class CommunityRecipesStore extends FeatureStore {
18 @computed get communityRecipes() { 22 @computed get communityRecipes() {
19 if (!this.stores) return []; 23 if (!this.stores) return [];
20 24
21 return this.stores.recipePreviews.dev.map(recipePreview => { 25 return this.stores.recipePreviews.dev.map(
22 // TODO: Need to figure out if this is even necessary/used 26 (recipePreview: { isDevRecipe: boolean; author: any[] }) => {
23 recipePreview.isDevRecipe = !!recipePreview.author.some( 27 // TODO: Need to figure out if this is even necessary/used
24 author => author.email === this.stores.user.data.email, 28 recipePreview.isDevRecipe = !!recipePreview.author.some(
25 ); 29 (author: { email: any }) =>
30 author.email === this.stores.user.data.email,
31 );
26 32
27 return recipePreview; 33 return recipePreview;
28 }); 34 },
35 );
29 } 36 }
30} 37}
31 38