mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Improve code style and readability
This commit is contained in:
parent
b5faa08bfd
commit
f5194c0be4
1 changed files with 26 additions and 24 deletions
|
@ -54,7 +54,7 @@ class Renderer {
|
|||
|
||||
const enabledSeparateGateways = Object.fromEntries(
|
||||
Object.entries( settings.separate_buttons ).filter(
|
||||
( [ s, data ] ) => document.querySelector( data.wrapper )
|
||||
( [ , data ] ) => document.querySelector( data.wrapper )
|
||||
)
|
||||
);
|
||||
const hasEnabledSeparateGateways =
|
||||
|
@ -70,10 +70,12 @@ class Renderer {
|
|||
);
|
||||
}
|
||||
} else {
|
||||
const allFundingSources = paypal.getFundingSources();
|
||||
const separateFunding = allFundingSources.filter(
|
||||
( s ) => ! ( s in enabledSeparateGateways )
|
||||
);
|
||||
// render each button separately
|
||||
for ( const fundingSource of paypal
|
||||
.getFundingSources()
|
||||
.filter( ( s ) => ! ( s in enabledSeparateGateways ) ) ) {
|
||||
for ( const fundingSource of separateFunding ) {
|
||||
const style = normalizeStyleForFundingSource(
|
||||
settings.button.style,
|
||||
fundingSource
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue