Fixed unsaved changes warning for prices when they've already been saved

no issue

- amount properties on the controller are set to strings rather than numbers so the comparison would still be false even if the "numbers" matched
This commit is contained in:
Kevin Ansfield 2021-05-19 20:44:41 +01:00
parent 6339770a67
commit 3bed117b57

View File

@ -62,10 +62,10 @@ export default class MembersAccessController extends Controller {
const monthlyPrice = this.getPrice(activePrices, 'monthly');
const yearlyPrice = this.getPrice(activePrices, 'yearly');
if (monthlyPrice?.amount && this.stripeMonthlyAmount !== (monthlyPrice.amount / 100)) {
if (monthlyPrice?.amount && parseInt(this.stripeMonthlyAmount) !== (monthlyPrice.amount / 100)) {
return true;
}
if (yearlyPrice?.amount && this.stripeYearlyAmount !== (yearlyPrice.amount / 100)) {
if (yearlyPrice?.amount && parseInt(this.stripeYearlyAmount) !== (yearlyPrice.amount / 100)) {
return true;
}
}