From 3dee4a4dd44d8652923711d8f64faa673b8ab527 Mon Sep 17 00:00:00 2001 From: Louison PARANT Date: Mon, 11 Dec 2023 08:26:50 +0100 Subject: [PATCH] Remove Console.Log --- LeftOvers/screens/FiltersSelection.tsx | 4 +--- LeftOvers/screens/HomePage.tsx | 4 ++-- LeftOvers/screens/IngredientSelection.tsx | 12 ++++++------ LeftOvers/screens/ModifyProfile.tsx | 5 ++--- LeftOvers/screens/RecipeDetails.tsx | 9 +-------- LeftOvers/screens/RecipeSuggestion.tsx | 2 +- 6 files changed, 13 insertions(+), 23 deletions(-) diff --git a/LeftOvers/screens/FiltersSelection.tsx b/LeftOvers/screens/FiltersSelection.tsx index b6ef962..34a5092 100644 --- a/LeftOvers/screens/FiltersSelection.tsx +++ b/LeftOvers/screens/FiltersSelection.tsx @@ -31,7 +31,6 @@ export default function FiltersSelection(props) { const subscriptionAddProfile = eventEmitter.addListener('profileAdded', async () => { fetchProfiles() - console.log("Technique de Shinobi Anti-CodeSmell", selectedDiets) subscriptionAddProfile.remove() eventEmitter.removeAllListeners('profileAdded') eventEmitter.removeAllListeners('updateDietsAllergies') @@ -67,7 +66,7 @@ export default function FiltersSelection(props) { fetchProfiles() eventEmitter.emit("selectedProfilesUpdated") } catch (error) { - console.error('Error occured when updating active profiles:', error); + console.error('Error occured when updating active profiles:', error, selectedDiets); } }; @@ -75,7 +74,6 @@ export default function FiltersSelection(props) { updateDiets() updateAllergies() eventEmitter.emit("updateDietsAllergies") - console.log("Filters Selection: ---------------------------------------------------") subscriptionUpdateProfiles.remove(); eventEmitter.removeAllListeners('profileAdded') eventEmitter.removeAllListeners('updateDietsAllergies') diff --git a/LeftOvers/screens/HomePage.tsx b/LeftOvers/screens/HomePage.tsx index e415269..7fed9f9 100644 --- a/LeftOvers/screens/HomePage.tsx +++ b/LeftOvers/screens/HomePage.tsx @@ -30,7 +30,7 @@ export default function HomePage({ navigation, props }) { const existingAvailableIngredient = await AsyncStorage.getItem('ingredient'); return JSON.parse(existingAvailableIngredient) || []; } catch (error) { - console.log(error); + console.error(error); return []; } } @@ -247,7 +247,7 @@ export default function HomePage({ navigation, props }) { {nbActiveProfiles()} selected - console.log("Ignorer", val)}/> + val += 1}/> navigation.navigate('FiltersSelection')}/> diff --git a/LeftOvers/screens/IngredientSelection.tsx b/LeftOvers/screens/IngredientSelection.tsx index 6fb8d4c..ec589a2 100644 --- a/LeftOvers/screens/IngredientSelection.tsx +++ b/LeftOvers/screens/IngredientSelection.tsx @@ -37,7 +37,7 @@ export default function IngredientSelection(props) { setResponse(filtered); } } catch (error) { - console.log(error); + console.error(error); } finally { setIsLoading(false); } @@ -52,7 +52,7 @@ const loadIngredients = async () => { try { setResponse(await ingredientService.getAllIngredient()); } catch (error) { - console.log(error); + console.error(error); } finally { setIsLoading(false); } @@ -95,7 +95,7 @@ const loadIngredients = async () => { const existingAvailableIngredient = await AsyncStorage.getItem('ingredient'); return JSON.parse(existingAvailableIngredient) || []; } catch (error) { - console.log(error); + console.error(error); return []; } } @@ -125,7 +125,7 @@ const fetchAvailableIngredient = async () => { } } catch(error){ - console.log("Error occured during the addition of Ingredient:", error) + console.error("Error occured during the addition of Ingredient:", error) } }; @@ -139,7 +139,7 @@ const fetchAvailableIngredient = async () => { ChangeAvailableSize(true) } catch (error){ - console.log("Error occured during the suppression of Ingredient:", error) + console.error("Error occured during the suppression of Ingredient:", error) } }; @@ -187,7 +187,7 @@ const fetchAvailableIngredient = async () => { const ingredientsByLetter = await ingredientService.getIngredientByLetter(letter); setResponse(ingredientsByLetter); } catch (error) { - console.log(error); + console.error(error); } finally { setIsLoading(false); } diff --git a/LeftOvers/screens/ModifyProfile.tsx b/LeftOvers/screens/ModifyProfile.tsx index 60a37b3..771c502 100644 --- a/LeftOvers/screens/ModifyProfile.tsx +++ b/LeftOvers/screens/ModifyProfile.tsx @@ -21,10 +21,9 @@ export default function ModifyProfile(props) { const profiles = JSON.parse(existingProfiles) || []; const matchedProfile = profiles.find(profile => profile.name === profileName); - console.log("Le profil choisit : " + matchedProfile); return matchedProfile || null; } catch (error) { - console.log("Erreur lors de la récupération du profil :", error); + console.error("Erreur lors de la récupération du profil :", error); return null; } }; @@ -45,7 +44,7 @@ useEffect(() => { - (console.log("Profile Modified"))}> + console.log("")}> diff --git a/LeftOvers/screens/RecipeDetails.tsx b/LeftOvers/screens/RecipeDetails.tsx index 33a0a72..553584c 100644 --- a/LeftOvers/screens/RecipeDetails.tsx +++ b/LeftOvers/screens/RecipeDetails.tsx @@ -102,7 +102,6 @@ export default function RecipeDetails({ route }) { return categories[0]; } - console.log("LA LISTE DES CATEGORY : " + categories) let bestMatch = { category: '', similarity: 0 }; for (const [name, categoriesList] of Object.entries(categoryMappings)) { @@ -119,20 +118,15 @@ export default function RecipeDetails({ route }) { function getImageForRecipe(recipeName: string) { const categories = []; - console.log("NAAAAAME : " + recipeName) for (const [category, words] of Object.entries(imagesDictionary)) { const matchedWords = words.filter((word) => recipeName.toLowerCase().includes(word)); - console.log("Matched Word : " + matchedWords) if (matchedWords.length > 0) { categories.push(category); - console.log(category) } } - console.log("ON ENTRE DANS LA 2EME FONCTION"); const categoryName = getCategoryFromList(categories); - console.log("CategoryName à la fin : " + categoryName); switch (categoryName) { case 'meat': @@ -179,10 +173,9 @@ export default function RecipeDetails({ route }) { const loadRecipe = async () => { try { const recipe = await recipesService.getRecipeById(recipeId); - console.log("Recipe.name: "+recipe.name) setResponse(recipe); } catch (error) { - console.log(error); + console.error(error); } finally{ setIsLoading(false) } diff --git a/LeftOvers/screens/RecipeSuggestion.tsx b/LeftOvers/screens/RecipeSuggestion.tsx index 2e6cb14..02a0149 100644 --- a/LeftOvers/screens/RecipeSuggestion.tsx +++ b/LeftOvers/screens/RecipeSuggestion.tsx @@ -99,7 +99,7 @@ export default function RecipeSuggestion({ route, navigation }) { } } catch (error) { - console.log(error) + console.error(error) } };