diff --git a/modules/ppcp-wc-gateway/resources/js/common/display-manager/Rule.js b/modules/ppcp-wc-gateway/resources/js/common/display-manager/Rule.js index 02ccdbf51..75e88f141 100644 --- a/modules/ppcp-wc-gateway/resources/js/common/display-manager/Rule.js +++ b/modules/ppcp-wc-gateway/resources/js/common/display-manager/Rule.js @@ -8,6 +8,7 @@ class Rule { this.conditions = {}; this.actions = {}; this.triggerUpdate = triggerUpdate; + this.status = null; const updateStatus = this.updateStatus.bind(this); for (const conditionConfig of this.config.conditions) { @@ -29,7 +30,7 @@ class Rule { return this.config.key; } - updateStatus() { + updateStatus(forceRunActions = false) { let status = true; for (const [key, condition] of Object.entries(this.conditions)) { @@ -40,6 +41,8 @@ class Rule { this.status = status; this.triggerUpdate(); this.runActions(); + } else if (forceRunActions) { + this.runActions(); } } @@ -57,7 +60,7 @@ class Rule { action.register(); } - this.updateStatus(); + this.updateStatus(true); } }