From f31a9f957f6c9e9880530b97593acf79401dce0a Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 6 Jan 2025 11:28:06 -0800 Subject: [PATCH] fix: Disallow adding comments to mutator workspaces. (#8720) --- core/contextmenu_items.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/contextmenu_items.ts b/core/contextmenu_items.ts index 25ffab59b..58429fb13 100644 --- a/core/contextmenu_items.ts +++ b/core/contextmenu_items.ts @@ -611,7 +611,9 @@ export function registerCommentDuplicate() { export function registerCommentCreate() { const createOption: RegistryItem = { displayText: () => Msg['ADD_COMMENT'], - preconditionFn: () => 'enabled', + preconditionFn: (scope: Scope) => { + return scope.workspace?.isMutator ? 'hidden' : 'enabled'; + }, callback: (scope: Scope, e: PointerEvent) => { const workspace = scope.workspace; if (!workspace) return;