Skip to content

Commit

Permalink
fix: Disallow adding comments to mutator workspaces. (#8720)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko authored Jan 6, 2025
1 parent 77c695a commit f31a9f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/contextmenu_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f31a9f9

Please sign in to comment.