From 3bed117b57dfcc68023fc5bc46602047d2b15364 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 19 May 2021 20:44:41 +0100 Subject: [PATCH] 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 --- ghost/admin/app/controllers/settings/membership.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/controllers/settings/membership.js b/ghost/admin/app/controllers/settings/membership.js index 9c6728d632..5e95217c7f 100644 --- a/ghost/admin/app/controllers/settings/membership.js +++ b/ghost/admin/app/controllers/settings/membership.js @@ -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; } }