fix: Disallow adding comments to mutator workspaces. (#8720)

This commit is contained in:
Aaron Dodson
2025-01-06 11:28:06 -08:00
committed by GitHub
parent 77c695a648
commit f31a9f957f

View File

@@ -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;