mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🦺 Add check for config that causes infinite loop
This commit is contained in:
parent
33c6c06e85
commit
93f3e4e7ac
2 changed files with 8 additions and 0 deletions
|
@ -135,6 +135,10 @@ class ApplepayButton {
|
|||
const { wrapper, ppcpButtonWrapper } = this.contextConfig();
|
||||
const wrapper_id = '#' + wrapper;
|
||||
|
||||
if (wrapper_id === ppcpButtonWrapper) {
|
||||
throw new Error(`[ApplePayButton] "wrapper" and "ppcpButtonWrapper" values must differ to avoid infinite loop. Current value: "${wrapper_id}"`);
|
||||
}
|
||||
|
||||
const syncButtonVisibility = () => {
|
||||
if (!this.isEligible) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue