diff --git a/services/web/frontend/js/features/editor-left-menu/hooks/use-root-doc-id.tsx b/services/web/frontend/js/features/editor-left-menu/hooks/use-root-doc-id.tsx index 632a3b3ce7..113e77883a 100644 --- a/services/web/frontend/js/features/editor-left-menu/hooks/use-root-doc-id.tsx +++ b/services/web/frontend/js/features/editor-left-menu/hooks/use-root-doc-id.tsx @@ -12,9 +12,7 @@ export default function useRootDocId() { const setRootDocIdFunc = useCallback( async (newRootDocId: ProjectSettings['rootDocId']) => { - // rootDocId will be undefined on angular scope on initialisation - const allowUpdate = - typeof rootDocId !== 'undefined' && permissionsLevel !== 'readOnly' + const allowUpdate = permissionsLevel !== 'readOnly' if (allowUpdate) { try { @@ -24,7 +22,7 @@ export default function useRootDocId() { } } }, - [permissionsLevel, rootDocId, saveProjectSettings] + [permissionsLevel, saveProjectSettings] ) return { diff --git a/services/web/frontend/js/features/ide-redesign/components/settings/compiler-settings/root-document-setting.tsx b/services/web/frontend/js/features/ide-redesign/components/settings/compiler-settings/root-document-setting.tsx index 719ea4da5a..38801c9dd6 100644 --- a/services/web/frontend/js/features/ide-redesign/components/settings/compiler-settings/root-document-setting.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/settings/compiler-settings/root-document-setting.tsx @@ -43,7 +43,7 @@ export default function RootDocumentSetting() { disabled={!write} options={validDocsOptions} onChange={setRootDocId} - value={rootDocId} + value={rootDocId ?? ''} translateOptions="no" /> )