mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
Check FF before validating payment component (#14840)
This commit is contained in:
@@ -117,9 +117,15 @@ export class SetupComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
submit = async () => {
|
submit = async () => {
|
||||||
try {
|
try {
|
||||||
|
const requireProviderPaymentMethodDuringSetup = await firstValueFrom(
|
||||||
|
this.requireProviderPaymentMethodDuringSetup$,
|
||||||
|
);
|
||||||
|
|
||||||
this.formGroup.markAllAsTouched();
|
this.formGroup.markAllAsTouched();
|
||||||
|
|
||||||
const paymentValid = this.paymentComponent.validate();
|
const paymentValid = requireProviderPaymentMethodDuringSetup
|
||||||
|
? this.paymentComponent.validate()
|
||||||
|
: true;
|
||||||
const taxInformationValid = this.taxInformationComponent.validate();
|
const taxInformationValid = this.taxInformationComponent.validate();
|
||||||
|
|
||||||
if (!paymentValid || !taxInformationValid || !this.formGroup.valid) {
|
if (!paymentValid || !taxInformationValid || !this.formGroup.valid) {
|
||||||
@@ -146,10 +152,6 @@ export class SetupComponent implements OnInit, OnDestroy {
|
|||||||
request.taxInfo.city = taxInformation.city;
|
request.taxInfo.city = taxInformation.city;
|
||||||
request.taxInfo.state = taxInformation.state;
|
request.taxInfo.state = taxInformation.state;
|
||||||
|
|
||||||
const requireProviderPaymentMethodDuringSetup = await firstValueFrom(
|
|
||||||
this.requireProviderPaymentMethodDuringSetup$,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (requireProviderPaymentMethodDuringSetup) {
|
if (requireProviderPaymentMethodDuringSetup) {
|
||||||
request.paymentSource = await this.paymentComponent.tokenize();
|
request.paymentSource = await this.paymentComponent.tokenize();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user