home, subscription and other fixes
This commit is contained in:
@@ -55,12 +55,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
return FAKE_PROGRESS_MAX;
|
||||
}
|
||||
|
||||
const increment =
|
||||
prevProgress < 60
|
||||
? 1
|
||||
: prevProgress < 80
|
||||
? 0.6
|
||||
: 0.3;
|
||||
const increment = prevProgress < 60 ? 1 : prevProgress < 80 ? 0.6 : 0.3;
|
||||
|
||||
const next = prevProgress + increment;
|
||||
return next >= FAKE_PROGRESS_MAX ? FAKE_PROGRESS_MAX : next;
|
||||
@@ -79,7 +74,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
});
|
||||
const sanitizedStructure = sanitizeStructureList(
|
||||
config?.structure,
|
||||
CUSTOM_SANITIZE_OPTIONS
|
||||
CUSTOM_SANITIZE_OPTIONS,
|
||||
);
|
||||
const callable = firebase
|
||||
.functions()
|
||||
@@ -142,7 +137,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
const rawMessage = typeof e?.message === "string" ? e.message : "";
|
||||
const cleanedMessage = rawMessage.replace(
|
||||
/^functions error: \w+-\w+:\s*/i,
|
||||
""
|
||||
"",
|
||||
);
|
||||
setError({
|
||||
message:
|
||||
@@ -172,7 +167,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
console.log("💾 [CreatingLyrics] Sauvegarde automatique des paroles");
|
||||
const sanitizedStructure = sanitizeStructureList(
|
||||
result?.structure || config?.structure,
|
||||
CUSTOM_SANITIZE_OPTIONS
|
||||
CUSTOM_SANITIZE_OPTIONS,
|
||||
);
|
||||
const baseConfig =
|
||||
config && typeof config === "object" && !Array.isArray(config)
|
||||
@@ -180,26 +175,30 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
: {};
|
||||
if (sanitizedStructure.length > 0) {
|
||||
baseConfig.structure = sanitizedStructure;
|
||||
} else if (Object.prototype.hasOwnProperty.call(baseConfig, "structure")) {
|
||||
} else if (
|
||||
Object.prototype.hasOwnProperty.call(baseConfig, "structure")
|
||||
) {
|
||||
delete baseConfig.structure;
|
||||
}
|
||||
const persistedConfig =
|
||||
Object.keys(baseConfig).length > 0 ? baseConfig : null;
|
||||
|
||||
let persistedSelections =
|
||||
selections && typeof selections === "object" && !Array.isArray(selections)
|
||||
selections &&
|
||||
typeof selections === "object" &&
|
||||
!Array.isArray(selections)
|
||||
? { ...selections }
|
||||
: null;
|
||||
if (persistedSelections) {
|
||||
if ("customStructure" in persistedSelections) {
|
||||
persistedSelections.customStructure = sanitizeStructureList(
|
||||
persistedSelections.customStructure,
|
||||
CUSTOM_SANITIZE_OPTIONS
|
||||
CUSTOM_SANITIZE_OPTIONS,
|
||||
);
|
||||
}
|
||||
if ("parsedStructure" in persistedSelections) {
|
||||
persistedSelections.parsedStructure = sanitizeStructureList(
|
||||
persistedSelections.parsedStructure
|
||||
persistedSelections.parsedStructure,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -252,7 +251,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
onPress: redirect,
|
||||
},
|
||||
],
|
||||
{ cancelable: false }
|
||||
{ cancelable: false },
|
||||
);
|
||||
|
||||
if (Platform.OS === "web") {
|
||||
@@ -274,22 +273,6 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
height: "50%",
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
zIndex: 1,
|
||||
position: "absolute",
|
||||
top: -150,
|
||||
width: "50%",
|
||||
height: "80%",
|
||||
alignSelf: "center",
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
source={ai.nathalie}
|
||||
style={{ width: "100%", height: "100%", right: -10 }}
|
||||
resizeMode="contain"
|
||||
/>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
@@ -344,7 +327,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
setSaved(true);
|
||||
await setIsLoading(true);
|
||||
console.log(
|
||||
"📄 [CreatingLyrics] Consultation manuelle du texte"
|
||||
"📄 [CreatingLyrics] Consultation manuelle du texte",
|
||||
);
|
||||
await updateProjectData({
|
||||
title: result?.title || "",
|
||||
@@ -359,7 +342,7 @@ const CreatingLyrics = ({ active, config, selections }) => {
|
||||
} catch (e) {
|
||||
console.error(
|
||||
"⚠️ [CreatingLyrics] Erreur lors de l'ouverture manuelle",
|
||||
e
|
||||
e,
|
||||
);
|
||||
} finally {
|
||||
await setIsLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user