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]);