mounts: bugfix to drop notif for food

This commit is contained in:
Tyler Renelle
2013-12-07 12:17:03 -07:00
parent 680f0e974e
commit 8f75b84b42

View File

@@ -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;
} }