Skip to content
Permalink
Browse files

Merge pull request #503 from britishben/owned-fix

Fix "undefined/4 copies in collection" tooltip
  • Loading branch information...
Manuel-777 committed Jul 28, 2019
2 parents 9210663 + 37bc807 commit ecc9cd827c8b1f1030a5df5938b1c7b9f37af1bb
Showing with 5 additions and 5 deletions.
  1. +5 −5 shared/card-hover.js
@@ -76,17 +76,17 @@ function attachOwnerhipStars(card, starContainer) {
starContainer.style.opacity = 1;

const owned = pd.cards.cards[card.id];
const aquired = pd.cardsNew[card.id];
starContainer.title = `${owned}/4 copies in collection`;
if (aquired) {
starContainer.title += ` (${aquired} recent)`;
const acquired = pd.cardsNew[card.id];
starContainer.title = `${owned || 0}/4 copies in collection`;
if (acquired) {
starContainer.title += ` (${acquired} recent)`;
}

for (let i = 0; i < 4; i++) {
let color = "gray";

if (i < owned) color = "green";
if (aquired && i >= owned - aquired && i < owned) color = "orange";
if (acquired && i >= owned - acquired && i < owned) color = "orange";

starContainer.appendChild(createDiv([`inventory_card_quantity_${color}`]));
}

0 comments on commit ecc9cd8

Please sign in to comment.
You can’t perform that action at this time.