From 5e78049a1b2c6de2ddb37457c1eaaffecad4b2cc Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 09:13:53 +0200 Subject: [PATCH] Remove unused dialogue handling functions and related code in App.tsx --- src/app/App.tsx | 105 ------------------------------------------------ 1 file changed, 105 deletions(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index b911c2e9..0a2a0464 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -4258,33 +4258,6 @@ export function App({ store, initialStatusMessage }: AppProps) { } }; - const applyProjectDialogues = ( - nextDialogues: typeof editorState.projectDocument.dialogues, - label: string, - successMessage: string - ) => { - if ( - areProjectDialogueLibrariesEqual( - editorState.projectDocument.dialogues, - nextDialogues - ) - ) { - return; - } - - try { - store.executeCommand( - createSetProjectDialoguesCommand({ - label, - dialogues: nextDialogues - }) - ); - setStatusMessage(successMessage); - } catch (error) { - setStatusMessage(getErrorMessage(error)); - } - }; - const applyProjectSequences = ( nextSequences: ProjectSequenceLibrary, label: string, @@ -4345,22 +4318,6 @@ export function App({ store, initialStatusMessage }: AppProps) { } }; - const updateProjectDialogues = ( - label: string, - successMessage: string, - mutate: (dialogues: typeof editorState.projectDocument.dialogues) => void - ) => { - try { - const nextDialogues = cloneProjectDialogueLibrary( - editorState.projectDocument.dialogues - ); - mutate(nextDialogues); - applyProjectDialogues(nextDialogues, label, successMessage); - } catch (error) { - setStatusMessage(getErrorMessage(error)); - } - }; - const updateProjectSequences = ( label: string, successMessage: string, @@ -4744,33 +4701,6 @@ export function App({ store, initialStatusMessage }: AppProps) { } }; - const handleAddProjectDialogue = () => { - const nextDialogue = createProjectDialogue(); - - updateProjectDialogues( - "Add project dialogue", - "Added project dialogue.", - (dialogues) => { - dialogues.dialogues[nextDialogue.id] = nextDialogue; - } - ); - setSelectedDialogueId(nextDialogue.id); - }; - - const handleDeleteProjectDialogue = (dialogueId: string) => { - updateProjectDialogues( - "Delete project dialogue", - "Deleted project dialogue.", - (dialogues) => { - delete dialogues.dialogues[dialogueId]; - } - ); - - if (selectedDialogueId === dialogueId) { - setSelectedDialogueId(null); - } - }; - const resolveSequenceControlTargetOption = (targetKey: string) => getProjectScheduleTargetOptionByKey(projectScheduleTargetOptions, targetKey); @@ -4900,41 +4830,6 @@ export function App({ store, initialStatusMessage }: AppProps) { } }; - const updateProjectDialogue = ( - dialogueId: string, - label: string, - successMessage: string, - mutate: (dialogue: ProjectDialogue) => void - ) => { - updateProjectDialogues(label, successMessage, (dialogues) => { - const dialogue = dialogues.dialogues[dialogueId]; - - if (dialogue === undefined) { - throw new Error("Selected dialogue no longer exists."); - } - - mutate(dialogue); - }); - }; - - const updateProjectDialogueLine = ( - dialogueId: string, - lineId: string, - label: string, - successMessage: string, - mutate: (line: ProjectDialogueLine) => void - ) => { - updateProjectDialogue(dialogueId, label, successMessage, (dialogue) => { - const line = dialogue.lines.find((candidate) => candidate.id === lineId); - - if (line === undefined) { - throw new Error("Selected dialogue line no longer exists."); - } - - mutate(line); - }); - }; - const handleAddProjectSequenceControlEffect = ( sequenceId: string, targetKey: string,