aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-09-26 11:55:53 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2019-09-26 11:55:53 +0200
commit1d171f4a65bf317fdd9aa3123e5fa57e87c7fe4c (patch)
treed764394cc53ac3998ee1e76f95962506c6b0b2e1
parentAdd local recipes to recipe list (diff)
downloadferdium-app-1d171f4a65bf317fdd9aa3123e5fa57e87c7fe4c.tar.gz
ferdium-app-1d171f4a65bf317fdd9aa3123e5fa57e87c7fe4c.tar.zst
ferdium-app-1d171f4a65bf317fdd9aa3123e5fa57e87c7fe4c.zip
Fix lint
-rw-r--r--src/containers/settings/RecipesScreen.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js
index 813c008f1..cff6bfd83 100644
--- a/src/containers/settings/RecipesScreen.js
+++ b/src/containers/settings/RecipesScreen.js
@@ -16,7 +16,7 @@ import { FRANZ_DEV_DOCS } from '../../config';
16import { communityRecipesStore } from '../../features/communityRecipes'; 16import { communityRecipesStore } from '../../features/communityRecipes';
17import RecipePreview from '../../models/RecipePreview'; 17import RecipePreview from '../../models/RecipePreview';
18 18
19import allFerdiRecipes from '../../../recipes/all.json' 19import allFerdiRecipes from '../../../recipes/all.json';
20 20
21const { app } = remote; 21const { app } = remote;
22 22
@@ -74,16 +74,16 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
74 prepareRecipes(recipes) { 74 prepareRecipes(recipes) {
75 return recipes 75 return recipes
76 // Filter out duplicate recipes 76 // Filter out duplicate recipes
77 .filter((recipe, index, self) => { 77 .filter((recipe, index, self) => {
78 const ids = self.map(rec => rec.id); 78 const ids = self.map(rec => rec.id);
79 return ids.indexOf(recipe.id) === index; 79 return ids.indexOf(recipe.id) === index;
80 80
81 // Sort alphabetically 81 // Sort alphabetically
82 }).sort((a, b) => { 82 }).sort((a, b) => {
83 if(a.id < b.id) { return -1; } 83 if (a.id < b.id) { return -1; }
84 if(a.id > b.id) { return 1; } 84 if (a.id > b.id) { return 1; }
85 return 0; 85 return 0;
86 }); 86 });
87 } 87 }
88 88
89 // Create an array of RecipePreviews from an array of recipe objects 89 // Create an array of RecipePreviews from an array of recipe objects
@@ -114,8 +114,8 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
114 if (filter === 'all') { 114 if (filter === 'all') {
115 recipeFilter = this.prepareRecipes([ 115 recipeFilter = this.prepareRecipes([
116 ...recipePreviews.all, 116 ...recipePreviews.all,
117 ...this.createPreviews(allFerdiRecipes) 117 ...this.createPreviews(allFerdiRecipes),
118 ]) 118 ]);
119 } else if (filter === 'dev') { 119 } else if (filter === 'dev') {
120 recipeFilter = communityRecipesStore.communityRecipes; 120 recipeFilter = communityRecipesStore.communityRecipes;
121 } else { 121 } else {
@@ -127,9 +127,9 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
127 ...recipePreviews.searchResults, 127 ...recipePreviews.searchResults,
128 // All search recipes from local recipes 128 // All search recipes from local recipes
129 ...this.createPreviews( 129 ...this.createPreviews(
130 allFerdiRecipes 130 allFerdiRecipes
131 .filter(service => service.name.toLowerCase().includes(this.state.needle.toLowerCase())) 131 .filter(service => service.name.toLowerCase().includes(this.state.needle.toLowerCase())),
132 ) 132 ),
133 ]) : recipeFilter; 133 ]) : recipeFilter;
134 134
135 const isLoading = recipePreviews.featuredRecipePreviewsRequest.isExecuting 135 const isLoading = recipePreviews.featuredRecipePreviewsRequest.isExecuting