mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Don't $watch drops (#7547)
* WIP(drops): get drops out of _tmp * fix(notifications): no watch for drops/mystery * fix(ops): only two response values * fix(test): update op expectation Also update API docs for modified route. * fix(lint): remove trailing space * fix(test): update integration check
This commit is contained in:
@@ -13,7 +13,6 @@ module.exports = function openMysteryItem (user, req = {}, analytics) {
|
||||
}
|
||||
|
||||
item = _.cloneDeep(content.gear.flat[item]);
|
||||
item.notificationType = 'Mystery';
|
||||
user.items.gear.owned[item.key] = true;
|
||||
|
||||
user.markModified('purchased.plan.mysteryItems');
|
||||
@@ -28,16 +27,11 @@ module.exports = function openMysteryItem (user, req = {}, analytics) {
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
if (!user._tmp) user._tmp = {};
|
||||
user._tmp.drop = item;
|
||||
}
|
||||
|
||||
if (req.v2 === true) {
|
||||
return user.items.gear.owned;
|
||||
} else {
|
||||
return [
|
||||
user.items.gear.owned,
|
||||
item,
|
||||
i18n.t('mysteryItemOpened', req.language),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user