navigate to home instead of floàw

This commit is contained in:
2025-10-03 14:39:12 +02:00
parent ce262f2d07
commit 680cc4852d
10 changed files with 95 additions and 59 deletions
+17 -23
View File
@@ -1,23 +1,17 @@
import { View, ScrollView, Alert } from "react-native";
import React, {
useMemo,
useState,
useCallback,
useEffect,
useRef,
} from "react";
import Page from "../../layouts/Page";
import MusicLandHeader from "../../components/MusicLandHeader";
import { navigate } from "../../navigation/NavigationService";
import { gutters } from "../../styles";
import React, { useCallback, useMemo, useRef, useState } from "react";
import { Alert, ScrollView, View } from "react-native";
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
import BorderGradientButton from "../../components/BorderGradientButton";
import GradientButton from "../../components/GradientButton";
import { Routes } from "../../navigation";
import CustomInput from "./components/CustomInput";
import ItemContainer from "../../components/ItemContainer/ItemContainer";
import MusicLandHeader from "../../components/MusicLandHeader";
import firebase, { projectsRef } from "../../config/firebase";
import useMinuit from "react-native-minuit/src/hooks/useMinuit.js";
import Page from "../../layouts/Page";
import { Routes } from "../../navigation";
import { navigate } from "../../navigation/NavigationService";
import { useUser } from "../../providers/UserDataProvider";
import { gutters } from "../../styles";
import CustomInput from "./components/CustomInput";
const Lyrics = ({ navigation }) => {
const scrollRef = useRef(null);
@@ -112,7 +106,7 @@ const Lyrics = ({ navigation }) => {
if (invalid) {
Alert.alert(
"Champs incomplets",
"Chaque couplet et refrain doit contenir du texte.",
"Chaque couplet et refrain doit contenir du texte."
);
return;
}
@@ -133,7 +127,7 @@ const Lyrics = ({ navigation }) => {
normalizedOldLyrics.every(
(s, i) =>
s.type === normalizedNewLyrics[i]?.type &&
s.lyrics === normalizedNewLyrics[i]?.lyrics,
s.lyrics === normalizedNewLyrics[i]?.lyrics
);
// 1) Appel de la Cloud Function de modération avant tout enregistrement
@@ -157,7 +151,7 @@ const Lyrics = ({ navigation }) => {
: null;
Alert.alert(
"Contenu interdit",
[data?.message, quotes].filter(Boolean).join("\n\n"),
[data?.message, quotes].filter(Boolean).join("\n\n")
);
return; // stop here
}
@@ -165,7 +159,7 @@ const Lyrics = ({ navigation }) => {
if (data?.errorCode === "ANALYSE_FAILED") {
Alert.alert(
"Analyse indisponible",
"Impossible de vérifier la toxicité pour le moment. Réessayez plus tard.",
"Impossible de vérifier la toxicité pour le moment. Réessayez plus tard."
);
return;
}
@@ -200,11 +194,11 @@ const Lyrics = ({ navigation }) => {
} catch (moderationError) {
console.log(
"Moderation call failed",
moderationError?.message || moderationError,
moderationError?.message || moderationError
);
Alert.alert(
"Analyse indisponible",
"Impossible de vérifier la toxicité pour le moment. Réessayez plus tard.",
"Impossible de vérifier la toxicité pour le moment. Réessayez plus tard."
);
return;
}
@@ -226,7 +220,7 @@ const Lyrics = ({ navigation }) => {
.doc(selectedProjectId)
.set(updateData, { merge: true });
}
navigate(Routes.FlowSelection);
navigate(Routes.Home);
} catch (e) {
console.log(e);
Alert.alert("Erreur", "Échec de l'enregistrement dans le projet.");
@@ -247,7 +241,7 @@ const Lyrics = ({ navigation }) => {
return (
<Page headerType="NONE">
<MusicLandHeader
onPressBack={() => navigate(Routes.FlowSelection)}
onPressBack={() => navigate(Routes.Home)}
progress={95}
/>
<View