mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
Fix reload on organization-payment-details page (#15601)
This commit is contained in:
@@ -156,13 +156,7 @@ export class OrganizationPaymentDetailsComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
const result = await lastValueFrom(dialogRef.closed);
|
const result = await lastValueFrom(dialogRef.closed);
|
||||||
if (result?.type === "success") {
|
if (result?.type === "success") {
|
||||||
this.setPaymentMethod(result.paymentMethod);
|
await this.setPaymentMethod(result.paymentMethod);
|
||||||
if (!view.billingAddress && result.paymentMethod.type !== "payPal") {
|
|
||||||
const billingAddress = await this.billingClient.getBillingAddress(view.organization);
|
|
||||||
if (billingAddress) {
|
|
||||||
this.setBillingAddress(billingAddress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.organizationFreeTrialWarningComponent.refresh();
|
this.organizationFreeTrialWarningComponent.refresh();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -176,11 +170,16 @@ export class OrganizationPaymentDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setPaymentMethod = (paymentMethod: MaskedPaymentMethod) => {
|
setPaymentMethod = async (paymentMethod: MaskedPaymentMethod) => {
|
||||||
if (this.viewState$.value) {
|
if (this.viewState$.value) {
|
||||||
|
const billingAddress =
|
||||||
|
this.viewState$.value.billingAddress ??
|
||||||
|
(await this.billingClient.getBillingAddress(this.viewState$.value.organization));
|
||||||
|
|
||||||
this.viewState$.next({
|
this.viewState$.next({
|
||||||
...this.viewState$.value,
|
...this.viewState$.value,
|
||||||
paymentMethod,
|
paymentMethod,
|
||||||
|
billingAddress,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user