mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Extract initSelectedCard()
This commit is contained in:
@@ -20,7 +20,7 @@ export default class extends Controller {
|
||||
.querySelector('[data-controller="stripe-cards"]'),
|
||||
"stripe-cards"
|
||||
);
|
||||
stripeCardSelector?.connect();
|
||||
stripeCardSelector?.initSelectedCard();
|
||||
}
|
||||
|
||||
doSelectPaymentMethod(paymentMethodContainerId) {
|
||||
|
||||
@@ -6,6 +6,10 @@ export default class extends Controller {
|
||||
static targets = ["stripeelements", "select"];
|
||||
|
||||
connect() {
|
||||
this.initSelectedCard()
|
||||
}
|
||||
|
||||
initSelectedCard() {
|
||||
if (this.hasSelectTarget) {
|
||||
this.selectCard(this.selectTarget.value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user