From cb97bb5170cf8293188a36028b5ab98c62d6dcb6 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 25 Apr 2024 13:01:15 +0100 Subject: [PATCH] Add "None" option to "Main document" menu when no root doc is set (#18102) GitOrigin-RevId: 5e1cd6bcbf070d7b6a92a1fcd69370361a3e6d3e --- .../components/settings/settings-document.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/editor-left-menu/components/settings/settings-document.tsx b/services/web/frontend/js/features/editor-left-menu/components/settings/settings-document.tsx index ee2ed6f692..e31794c29b 100644 --- a/services/web/frontend/js/features/editor-left-menu/components/settings/settings-document.tsx +++ b/services/web/frontend/js/features/editor-left-menu/components/settings/settings-document.tsx @@ -24,6 +24,14 @@ export default function SettingsDocument() { label: doc.path, })) + if (!rootDocId) { + mappedDocs.unshift({ + value: '', + label: 'None', + disabled: true, + }) + } + return mappedDocs }, [docs, rootDocId]) @@ -34,7 +42,7 @@ export default function SettingsDocument() { return (