mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-11 13:30:39 +01:00
Don't invoke ManageTaxInformationComponent when CB is disabled (#9614)
This commit is contained in:
parent
4d27824064
commit
7c16410c86
@ -119,9 +119,15 @@ export class SetupComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
submit = async () => {
|
submit = async () => {
|
||||||
try {
|
try {
|
||||||
|
const consolidatedBillingEnabled = await firstValueFrom(this.enableConsolidatedBilling$);
|
||||||
|
|
||||||
this.formGroup.markAllAsTouched();
|
this.formGroup.markAllAsTouched();
|
||||||
const taxInformationValid = this.manageTaxInformationComponent.touch();
|
|
||||||
if (this.formGroup.invalid || !taxInformationValid) {
|
const formIsValid = consolidatedBillingEnabled
|
||||||
|
? this.formGroup.valid && this.manageTaxInformationComponent.touch()
|
||||||
|
: this.formGroup.valid;
|
||||||
|
|
||||||
|
if (!formIsValid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,9 +140,7 @@ export class SetupComponent implements OnInit, OnDestroy {
|
|||||||
request.token = this.token;
|
request.token = this.token;
|
||||||
request.key = key;
|
request.key = key;
|
||||||
|
|
||||||
const enableConsolidatedBilling = await firstValueFrom(this.enableConsolidatedBilling$);
|
if (consolidatedBillingEnabled) {
|
||||||
|
|
||||||
if (enableConsolidatedBilling) {
|
|
||||||
request.taxInfo = new ExpandedTaxInfoUpdateRequest();
|
request.taxInfo = new ExpandedTaxInfoUpdateRequest();
|
||||||
const taxInformation = this.manageTaxInformationComponent.getTaxInformation();
|
const taxInformation = this.manageTaxInformationComponent.getTaxInformation();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user