Remove unused dialogue handling functions and related code in App.tsx

This commit is contained in:
2026-04-15 09:13:53 +02:00
parent 89a353db4f
commit 5e78049a1b

View File

@@ -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,