mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Ignore actions.enable/disable errors
Can happen when buttons were destroyed. Unclear if we really need to call this at all, CSS may be enough already.
This commit is contained in:
parent
465649ba15
commit
a2f61e9505
1 changed files with 10 additions and 2 deletions
|
@ -165,14 +165,22 @@ class Renderer {
|
|||
if (!this.buttonsOptions[wrapper]) {
|
||||
return;
|
||||
}
|
||||
this.buttonsOptions[wrapper].actions.disable();
|
||||
try {
|
||||
this.buttonsOptions[wrapper].actions.disable();
|
||||
} catch (err) {
|
||||
console.log('Failed to disable buttons: ' + err);
|
||||
}
|
||||
}
|
||||
|
||||
enableSmartButtons(wrapper) {
|
||||
if (!this.buttonsOptions[wrapper]) {
|
||||
return;
|
||||
}
|
||||
this.buttonsOptions[wrapper].actions.enable();
|
||||
try {
|
||||
this.buttonsOptions[wrapper].actions.enable();
|
||||
} catch (err) {
|
||||
console.log('Failed to enable buttons: ' + err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue