Remove Console.Log
continuous-integration/drone/push Build is passing Details

pull/24/head^2
Louison PARANT 1 year ago
parent 4cbc138fb8
commit 3dee4a4dd4

@ -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')

@ -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 }) {
<Text style={styles.nbSelected}>{nbActiveProfiles()} selected</Text>
</View>
<View style={{marginTop: "3%"}}/>
<ProfileSelection listProfile={profiles} disableSelection={true} changeStatusWaiting={(val) => console.log("Ignorer", val)}/>
<ProfileSelection listProfile={profiles} disableSelection={true} changeStatusWaiting={(val) => val += 1}/>
<View style={{marginTop: "4%"}}/>
<ValidateButton title="Change Active Filters" image="update.png" colour={colors.buttonDetail} backColour={colors.buttonBackground} todo={() => navigation.navigate('FiltersSelection')}/>
<View style={{marginTop: "3%"}}/>

@ -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);
}

@ -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(() => {
<View style={{marginTop: "6%"}}/>
<ProfileModification name={profile.name} avatar={profile.avatar} diets={profile.diets} allergies={profile.allergies}></ProfileModification>
<View style={{marginTop: "3%"}}/>
<ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={() => (console.log("Profile Modified"))}></ValidateButton>
<ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={() => console.log("")}></ValidateButton>
<View style={{marginTop: "20%"}}/>
</LinearGradient>
</ScrollView>

@ -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)
}

@ -99,7 +99,7 @@ export default function RecipeSuggestion({ route, navigation }) {
}
} catch (error) {
console.log(error)
console.error(error)
}
};

Loading…
Cancel
Save