fix: prevent deletion of library procedures
- Skip delete button creation for readonly blocks (data-readonly) - Add WCProcedure.delete() override that guards against readonly
This commit is contained in:
@@ -25,6 +25,11 @@ const LIB_ICONS = {
|
||||
|
||||
/** Procedure definition block with inputs/outputs/description/return-style. Lives in the Procedures tab. */
|
||||
class WCProcedure extends WCBlock {
|
||||
delete() {
|
||||
if (this.dataset.readonly) { showError("Cannot delete a library procedure."); return; }
|
||||
super.delete();
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this._el.naturalName = this._require(".proc-natural-name");
|
||||
|
||||
Reference in New Issue
Block a user