0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed unsaved change modal on new prices

no refs

When creating new prices on save in membership settings, we were incorrectly calculating if price has changed since the last save and showing the unsaved changes modal incorrectly.
This commit is contained in:
Rishabh 2021-05-20 14:52:21 +05:30
parent 5ca0ad0ef6
commit 510e31e6e6

View file

@ -58,6 +58,7 @@ export default class MembersAccessController extends Controller {
get hasChangedPrices() { get hasChangedPrices() {
if (this.product) { if (this.product) {
this.stripePrices = this.product.get('stripePrices') || [];
const activePrices = this.stripePrices.filter(price => !!price.active); const activePrices = this.stripePrices.filter(price => !!price.active);
const monthlyPrice = this.getPrice(activePrices, 'monthly'); const monthlyPrice = this.getPrice(activePrices, 'monthly');
const yearlyPrice = this.getPrice(activePrices, 'yearly'); const yearlyPrice = this.getPrice(activePrices, 'yearly');