mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Add admin display rules adjustments
This commit is contained in:
parent
e31e09f0c7
commit
71fc53f495
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue