mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
load button component in JS sdk only when needed
This commit is contained in:
parent
a4aea53302
commit
cc4777273a
2 changed files with 44 additions and 8 deletions
|
@ -11,7 +11,7 @@ class Renderer {
|
|||
}
|
||||
|
||||
renderButtons(wrapper, contextConfig) {
|
||||
if (! document.querySelector(wrapper) || this.isAlreadyRendered(wrapper)) {
|
||||
if (! document.querySelector(wrapper) || this.isAlreadyRendered(wrapper) || 'undefined' === typeof paypal.Buttons ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue