last tickets
This commit is contained in:
@@ -11,7 +11,6 @@ import { Routes } from "../../navigation";
|
||||
import { goBack, navigate } from "../../navigation/NavigationService";
|
||||
import { useUserData } from "../../providers/UserDataProvider";
|
||||
import { gutters, Palette, Style } from "../../styles";
|
||||
import { getStageAction } from "../../utils/projectStages";
|
||||
import CreateLyricsHeader from "../Writing/components/CreateLyricsHeader";
|
||||
|
||||
const ValidateCover = () => {
|
||||
@@ -91,39 +90,11 @@ const ValidateCover = () => {
|
||||
if (!selectedOption) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await setIsLoading(true);
|
||||
const existingCover = selectedProject?.cover || {};
|
||||
const finalUrl =
|
||||
selectedOption.finalUrl || selectedOption.generatedUrl || null;
|
||||
const nextCoverData = {
|
||||
...existingCover,
|
||||
options: coverOptions,
|
||||
selectedOptionId: selectedOption.id,
|
||||
result: finalUrl,
|
||||
generatedBackground:
|
||||
selectedOption.generatedUrl || selectedOption.finalUrl || null,
|
||||
};
|
||||
await updateProjectData({
|
||||
cover: nextCoverData,
|
||||
coverUrl: finalUrl,
|
||||
});
|
||||
const projectForStage = {
|
||||
...selectedProject,
|
||||
cover: nextCoverData,
|
||||
coverUrl: finalUrl,
|
||||
};
|
||||
const playbackStage = getStageAction("director", projectForStage);
|
||||
await setIsLoading(false);
|
||||
const targetRoute = playbackStage?.route || Routes.Playback;
|
||||
const params = playbackStage?.params || { project: projectForStage };
|
||||
navigate(targetRoute, params);
|
||||
return;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
await setIsLoading(false);
|
||||
}
|
||||
navigate(Routes.SongDownload, {
|
||||
project: selectedProject,
|
||||
selectedOption,
|
||||
coverOptions,
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user