mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
v3 adapt v2: fix tags _id, stickyHeader and unlocking
This commit is contained in:
@@ -44,9 +44,11 @@ module.exports = function unlock (user, req = {}, analytics) {
|
||||
|
||||
if (alreadyOwnedItems === setPaths.length) {
|
||||
throw new NotAuthorized(i18n.t('alreadyUnlocked', req.language));
|
||||
} else if (alreadyOwnedItems > 0) {
|
||||
// TODO write math formula to check if buying the full set is cheaper than the items individually
|
||||
// (item cost * number of remaining items) < setCost`
|
||||
} /* else if (alreadyOwnedItems > 0) {
|
||||
throw new NotAuthorized(i18n.t('alreadyUnlockedPart', req.language));
|
||||
}
|
||||
} */
|
||||
} else {
|
||||
alreadyOwns = _.get(user, `purchased.${path}`) === true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user