Skip to content

Commit f31a9f9

Browse files
authored
fix: Disallow adding comments to mutator workspaces. (#8720)
1 parent 77c695a commit f31a9f9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

core/contextmenu_items.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,9 @@ export function registerCommentDuplicate() {
611611
export function registerCommentCreate() {
612612
const createOption: RegistryItem = {
613613
displayText: () => Msg['ADD_COMMENT'],
614-
preconditionFn: () => 'enabled',
614+
preconditionFn: (scope: Scope) => {
615+
return scope.workspace?.isMutator ? 'hidden' : 'enabled';
616+
},
615617
callback: (scope: Scope, e: PointerEvent) => {
616618
const workspace = scope.workspace;
617619
if (!workspace) return;

0 commit comments

Comments
 (0)