From a1605dadc6a0a3cced8df7c599f2df50eee5c6f8 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Tue, 28 Apr 2020 15:19:57 +0200 Subject: [PATCH] [bug]: fix error when unauthenticated user renders page --- jsconfig.json | 6 ++++++ src/controllers/MealController.jsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..5875dc5 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "baseUrl": "src" + }, + "include": ["src"] +} diff --git a/src/controllers/MealController.jsx b/src/controllers/MealController.jsx index a47c1dc..1975db1 100644 --- a/src/controllers/MealController.jsx +++ b/src/controllers/MealController.jsx @@ -44,7 +44,7 @@ export const MealController = ({ meal, getMeal, getRandomMeal }) => { if (idMeal !== "52837" && isAuthenticated) { fb.isFav(user.email, idMeal).then((res) => setIsFav(res)); } - }, [user.email, fb, idMeal, isAuthenticated]); + }, [user, fb, idMeal, isAuthenticated]); const item = { mealName: strMeal,