From ee5096847483b2b37961c87fef03e2f9e96f1ab5 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 14 Apr 2026 19:59:05 +0200 Subject: [PATCH] Ensure selected dialogue ID is set on initial load --- src/app/App.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index 3bfd019e..0b728363 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -2478,6 +2478,22 @@ export function App({ store, initialStatusMessage }: AppProps) { setPlayerStartKeyboardCaptureAction(null); }, [selectedPlayerStart?.id]); + useEffect(() => { + if ( + selectedDialogueId !== null && + editorState.projectDocument.dialogues.dialogues[selectedDialogueId] !== + undefined + ) { + return; + } + + setSelectedDialogueId(projectDialogueList[0]?.id ?? null); + }, [ + editorState.projectDocument.dialogues.dialogues, + projectDialogueList, + selectedDialogueId + ]); + useEffect(() => { schedulePaneHeightRef.current = schedulePaneHeight; }, [schedulePaneHeight]);