mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
fix: Disallow adding comments to mutator workspaces. (#8720)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user