Skip to content

Commit

Permalink
fix: Disable newly created function call blocks when the correspondin…
Browse files Browse the repository at this point in the history
…g definition is disabled.
  • Loading branch information
gonfunko committed Nov 18, 2024
1 parent f1cbaab commit 99664e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions blocks/procedures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@ const PROCEDURE_CALL_COMMON = {
xml.appendChild(block);
Xml.domToWorkspace(xml, this.workspace);
Events.setGroup(false);
} else if (!def.isEnabled()) {
this.setDisabledReason(
true,
DISABLED_PROCEDURE_DEFINITION_DISABLED_REASON,
);
this.setWarningText(
Msg['PROCEDURES_CALL_DISABLED_DEF_WARNING'].replace('%1', name),
);
}
} else if (event.type === Events.BLOCK_DELETE) {
// Look for the case where a procedure definition has been deleted,
Expand Down

0 comments on commit 99664e4

Please sign in to comment.