mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
mounts: bugfix to drop notif for food
This commit is contained in:
@@ -31,7 +31,9 @@ habitrpg.controller('NotificationCtrl',
|
|||||||
$rootScope.$watch('user._tmp.drop', function(after, before){
|
$rootScope.$watch('user._tmp.drop', function(after, before){
|
||||||
// won't work when getting the same item twice?
|
// won't work when getting the same item twice?
|
||||||
if (after == before || !after) return;
|
if (after == before || !after) return;
|
||||||
var type = after.type === 'HatchingPotion' ? 'hatchingPotions' : (after.type.toLowerCase() + 's')
|
var type = (after.type == 'Food') ? 'food' :
|
||||||
|
(after.type == 'HatchingPotion') ? 'hatchingPotions' : // can we use camelcase and remove this line?
|
||||||
|
(after.type.toLowerCase() + 's');
|
||||||
if(!User.user.items[type][after.name]){
|
if(!User.user.items[type][after.name]){
|
||||||
User.user.items[type][after.name] = 0;
|
User.user.items[type][after.name] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user