diff --git a/src/zen/spaces/ZenSpaceManager.mjs b/src/zen/spaces/ZenSpaceManager.mjs index beae4b055..257a81318 100644 --- a/src/zen/spaces/ZenSpaceManager.mjs +++ b/src/zen/spaces/ZenSpaceManager.mjs @@ -2396,7 +2396,8 @@ class nsZenWorkspaces { w => w.uuid !== this.activeWorkspace ); const ctxCommand = document.getElementById("cmd_zenCtxDeleteWorkspace"); - if (workspaces.length <= 1) { + const hasMultipleWorkspaces = !!workspaces.length; + if (!hasMultipleWorkspaces) { ctxCommand.setAttribute("disabled", "true"); } else { ctxCommand.removeAttribute("disabled"); @@ -2416,6 +2417,9 @@ class nsZenWorkspaces { )) { item.remove(); } + if (!hasMultipleWorkspaces) { + continue; + } const separator = document.createXULElement("menuseparator"); separator.classList.add("zen-workspace-context-menu-item"); if (isMoveTabPopup) {