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
|
@ -139,6 +139,10 @@ class GooglepayButton {
|
|||
initEventHandlers() {
|
||||
const { wrapper, ppcpButtonWrapper } = this.contextConfig();
|
||||
|
||||
if (wrapper === ppcpButtonWrapper) {
|
||||
throw new Error(`[GooglePayButton] "wrapper" and "ppcpButtonWrapper" values must differ to avoid infinite loop. Current value: "${wrapper}"`);
|
||||
}
|
||||
|
||||
const syncButtonVisibility = () => {
|
||||
const $ppcpButtonWrapper = jQuery(ppcpButtonWrapper);
|
||||
setVisible(wrapper, $ppcpButtonWrapper.is(':visible'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue