diff --git a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx index fa6c3f34eb..f32af6f0cb 100644 --- a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx @@ -58,7 +58,7 @@ export type EditorManager = { openDoc: (document: Doc, options?: OpenDocOptions) => void openDocs: OpenDocuments openFileWithId: (fileId: string) => void - openInitialDoc: (docId: string) => void + openInitialDoc: (docId?: string) => void isLoading: boolean jumpToLine: (options: GotoLineOptions) => void debugTimers: React.MutableRefObject> @@ -513,7 +513,7 @@ export const EditorManagerProvider: FC = ({ ) const openInitialDoc = useCallback( - (fallbackDocId: string) => { + (fallbackDocId?: string) => { const docId = customLocalStorage.getItem(currentDocumentIdStorageKey) || fallbackDocId if (docId) { diff --git a/services/web/frontend/js/features/ide-react/context/file-tree-open-context.tsx b/services/web/frontend/js/features/ide-react/context/file-tree-open-context.tsx index 0b0003654a..426e8b64f3 100644 --- a/services/web/frontend/js/features/ide-react/context/file-tree-open-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/file-tree-open-context.tsx @@ -134,12 +134,7 @@ export const FileTreeOpenProvider: FC = ({ // Open a document once the file tree and project are ready const initialOpenDoneRef = useRef(false) useEffect(() => { - if ( - rootDocId && - fileTreeReady && - projectJoined && - !initialOpenDoneRef.current - ) { + if (fileTreeReady && projectJoined && !initialOpenDoneRef.current) { initialOpenDoneRef.current = true openInitialDoc(rootDocId) }