From 5985eeff2ef2bd04be280633bd36550ea8f8d689 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 14 Apr 2026 19:57:56 +0200 Subject: [PATCH] Add function to update project dialogues with error handling --- src/app/App.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index 7c915a7e..8042f15d 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -3821,6 +3821,22 @@ 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 updateProjectTimeSettings = ( label: string, successMessage: string,