Skip to content

Commit

Permalink
Check size of availableComponents and preselect only remaining option
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Schneider-Swales committed Oct 11, 2024
1 parent 5914d44 commit d09c667
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,12 @@ async function initPayment() {
});

// Show this component by default if it is the only one in the available components
if (availableComponents.length === 1) {
if (availableComponents.size === 1) {
cardsRadio.click();
}
}
else {
if (availableComponents.length === 1) {
if (availableComponents.size === 1) {
cardsRadio.click();
}
}
Expand Down Expand Up @@ -474,12 +474,12 @@ async function initPayment() {
});

// Show this component by default if it is the only one in the available components
if (availableComponents.length === 1) {
if (availableComponents.size === 1) {
afterpayRadio.click();
}
}
else {
if (availableComponents.length === 1) {
if (availableComponents.size === 1) {
afterpayRadio.click();
}
}
Expand Down Expand Up @@ -520,12 +520,12 @@ async function initPayment() {
});

// Show this component by default if it is the only one in the available components
if (availableComponents.length === 1) {
if (availableComponents.size === 1) {
klarnaRadio.click();
}
}
else {
if (availableComponents.length === 1) {
if (availableComponents.size === 1) {
klarnaRadio.click();
}
}
Expand Down

0 comments on commit d09c667

Please sign in to comment.