Skip to content

Commit

Permalink
handles no charms
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelyszabo94 committed Dec 8, 2024
1 parent f9cf89b commit c580dde
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions extension/src/contentScripts/steam/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,18 @@ const setStickerInfo = (stickers, charms) => {

if (charms) {
const charm = charms[0];
document.querySelectorAll('.customStickers').forEach((customStickers) => {
const stickerSlots = customStickers.querySelectorAll('.stickerSlot');
const charmEl = stickerSlots[stickerSlots.length - 1];

if (charmEl !== undefined) {
const currentToolTipText = charmEl.getAttribute('data-tooltip');
charmEl.setAttribute('data-tooltip', `${currentToolTipText} - Pattern: #${charm.pattern}`);
}
});
if (charm && charm.pattern) {
document.querySelectorAll('.customStickers').forEach((customStickers) => {
const stickerSlots = customStickers.querySelectorAll('.stickerSlot');
const charmEl = stickerSlots[stickerSlots.length - 1];

if (charmEl !== undefined) {
const currentToolTipText = charmEl.getAttribute('data-tooltip');
charmEl.setAttribute('data-tooltip', `${currentToolTipText} - Pattern: #${charm.pattern}`);
}
});
}
}
};

Expand Down

0 comments on commit c580dde

Please sign in to comment.