Fixed upgrades for paid members (#15760)

closes https://github.com/TryGhost/Team/issues/2202

Some parts of the codebase were not using the isSameCurrency helper
which meant that we were incorrectly filtering out tiers from the
upgrade screen. Tiers used to *usually* have a lowercased currency
property, but they now _always_ have an uppercased.
This commit is contained in:
Fabien 'egg' O'Carroll 2022-11-03 09:45:34 +07:00 committed by GitHub
parent 0bccbcb083
commit f9c31dd902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,13 +105,13 @@ export function getUpgradeProducts({site, member}) {
return availableProducts;
}
return availableProducts.filter((product) => {
return (getProductCurrency({product}) === activePriceCurrency);
return (isSameCurrency(getProductCurrency({product}), activePriceCurrency));
});
}
export function getFilteredPrices({prices, currency}) {
return prices.filter((d) => {
return (d.currency || '').toLowerCase() === (currency || '').toLowerCase();
return isSameCurrency((d.currency || ''), (currency || ''));
});
}