diff --git a/common/script/index.coffee b/common/script/index.coffee index 4cdde33b0b..93741f149b 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1178,7 +1178,7 @@ api.wrap = (user, main=true) -> item = content.gear.flat[item] user.items.gear.owned[item.key] = true user.markModified? 'purchased.plan.mysteryItems' - item.type = 'Mystery' + item.notificationType = 'Mystery' # needed for website/public/js/controllers/notificationCtrl.js line 59 approx. analyticsData = { uuid: user._id, itemKey: item, diff --git a/website/public/js/controllers/notificationCtrl.js b/website/public/js/controllers/notificationCtrl.js index df42c010f3..3079e32ca7 100644 --- a/website/public/js/controllers/notificationCtrl.js +++ b/website/public/js/controllers/notificationCtrl.js @@ -62,7 +62,10 @@ habitrpg.controller('NotificationCtrl', var text, notes, type; $rootScope.playSound('Item_Drop'); - if (after.type !== 'gear' && after.type !== 'Quest' && after.type !== 'Mystery') { + // Note: For Mystery Item gear, after.type will be 'head', 'armor', etc + // so we use after.notificationType below. + + if (after.type !== 'gear' && after.type !== 'Quest' && after.notificationType !== 'Mystery') { if (after.type === 'Food') { type = 'food'; } else if (after.type === 'HatchingPotion') { @@ -91,7 +94,7 @@ habitrpg.controller('NotificationCtrl', } else if (after.type === 'Quest') { $rootScope.selectedQuest = Content.quests[after.key]; $rootScope.openModal('questDrop', {controller:'PartyCtrl'}); - } else if (after.type === 'Mystery') { + } else if (after.notificationType === 'Mystery') { text = Content.gear.flat[after.key].text(); Notification.drop(env.t('messageDropMysteryItem', {dropText: text}), after); } else {