From 7045b5c214233c12fe6fc261853398e4aa41f988 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Mon, 2 Oct 2017 09:26:41 +0200 Subject: [PATCH] update notifications lib --- website/client/libs/notifications.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/website/client/libs/notifications.js b/website/client/libs/notifications.js index 49610972c4..c9fd12db80 100644 --- a/website/client/libs/notifications.js +++ b/website/client/libs/notifications.js @@ -1,15 +1,17 @@ -export function getDropClass (item) { +export function getDropClass ({type, key}) { let dropClass = ''; - if (item) { - switch (item.type) { + + if (type) { + switch (type) { case 'Egg': - dropClass = `Pet_Egg_${item.key}`; + dropClass = `Pet_Egg_${key}`; break; case 'HatchingPotion': - dropClass = `Pet_HatchingPotion_${item.key}`; + dropClass = `Pet_HatchingPotion_${key}`; break; case 'Food': - dropClass = `Pet_Food_${item.key}`; + case 'food': + dropClass = `Pet_Food_${key}`; break; case 'armor': case 'back': @@ -19,11 +21,13 @@ export function getDropClass (item) { case 'headAccessory': case 'shield': case 'weapon': - dropClass = `shop_${item.key}`; + case 'gear': + dropClass = `shop_${key}`; break; default: dropClass = 'glyphicon glyphicon-gift'; } } + return dropClass; -} +} \ No newline at end of file