mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
Added check for balance with respect to quantity (#9469)
This commit is contained in:
@@ -138,7 +138,7 @@ module.exports = function purchase (user, req = {}, analytics) {
|
||||
throw new NotAuthorized(i18n.t('messageNotAvailable', req.language));
|
||||
}
|
||||
|
||||
if (!user.balance || user.balance < price) {
|
||||
if (!user.balance || user.balance < price * quantity) {
|
||||
throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user