aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/features/communityRecipes/store.js1
-rw-r--r--src/models/Recipe.js12
2 files changed, 3 insertions, 10 deletions
diff --git a/src/features/communityRecipes/store.js b/src/features/communityRecipes/store.js
index b115a53e1..a3614dd11 100644
--- a/src/features/communityRecipes/store.js
+++ b/src/features/communityRecipes/store.js
@@ -19,6 +19,7 @@ export class CommunityRecipesStore extends FeatureStore {
19 if (!this.stores) return []; 19 if (!this.stores) return [];
20 20
21 return this.stores.recipePreviews.dev.map((r) => { 21 return this.stores.recipePreviews.dev.map((r) => {
22 // TODO: Need to figure out if this is even necessary/used
22 r.isDevRecipe = !!r.author.find((a) => a.email === this.stores.user.data.email); 23 r.isDevRecipe = !!r.author.find((a) => a.email === this.stores.user.data.email);
23 24
24 return r; 25 return r;
diff --git a/src/models/Recipe.js b/src/models/Recipe.js
index 92ff0d67d..e616055d6 100644
--- a/src/models/Recipe.js
+++ b/src/models/Recipe.js
@@ -1,9 +1,9 @@
1import emailParser from 'address-rfc2822';
2import semver from 'semver'; 1import semver from 'semver';
3import { pathExistsSync } from 'fs-extra'; 2import { pathExistsSync } from 'fs-extra';
4import { join } from 'path'; 3import { join } from 'path';
5 4
6export default class Recipe { 5export default class Recipe {
6 // Note: Do NOT change these default values. If they change, then the corresponding changes in the recipes needs to be done
7 id = ''; 7 id = '';
8 8
9 name = ''; 9 name = '';
@@ -60,8 +60,6 @@ export default class Recipe {
60 60
61 this.id = data.id || this.id; 61 this.id = data.id || this.id;
62 this.name = data.name || this.name; 62 this.name = data.name || this.name;
63 this.rawAuthor = data.author || this.author;
64 this.description = data.description || this.description;
65 this.version = data.version || this.version; 63 this.version = data.version || this.version;
66 this.path = data.path; 64 this.path = data.path;
67 65
@@ -86,14 +84,8 @@ export default class Recipe {
86 this.message = data.config.message || this.message; 84 this.message = data.config.message || this.message;
87 } 85 }
88 86
87 // TODO: Need to remove this if its not used anywhere
89 get author() { 88 get author() {
90 try {
91 const addresses = emailParser.parse(this.rawAuthor);
92 return addresses.map((a) => ({ email: a.address, name: a.phrase }));
93 } catch (err) {
94 console.warn(`Not a valid author for ${this.name}`);
95 }
96
97 return []; 89 return [];
98 } 90 }
99 91