From 67b092700a9dcbb005c9319e33e1bafd9a1d9a53 Mon Sep 17 00:00:00 2001 From: Index Date: Tue, 23 Jul 2024 17:47:13 -0500 Subject: [PATCH] fix: used wrong variable lol avatar sandbox --- js/account/avatar-sandbox.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/js/account/avatar-sandbox.js b/js/account/avatar-sandbox.js index a501723..f6bc8cf 100644 --- a/js/account/avatar-sandbox.js +++ b/js/account/avatar-sandbox.js @@ -617,13 +617,11 @@ async function LoadItems() { document.getElementById('inventory').classList.add('itemgrid') if (TabSelected !== 'outfit') { Items.assets.forEach(item => { - if (TabSelected !== "retro") { - if (item.price === null) { - item.price = false - } + if (TabSelected !== "retro" && item.price === null) { + item.price = false } - const Ribbon = ChooseRibbon(item) + const Ribbon = ChooseRibbon(item, false) const ItemColumn = document.createElement('div') ItemColumn.classList = 'col-auto' @@ -866,7 +864,7 @@ function LoadWearing() { if (Cached.price === undefined || Cached.price === null) { Cached.price = "???" } - const Ribbon = ChooseRibbon(Cached) + const Ribbon = ChooseRibbon(Cached, true) const ItemColumn = document.createElement('div') ItemColumn.classList = 'col-auto' @@ -897,7 +895,7 @@ function LoadWearing() { }) if (Ribbon !== null) { ItemColumn.getElementsByClassName('ribbon')[0].addEventListener('click', function(){ - WearAsset(item, item.id) + WearAsset(Cached, id) }) } } @@ -970,7 +968,7 @@ function FormatPrice(price) { return '">how did this happen' } -function ChooseRibbon(item) { +function ChooseRibbon(item, wearing) { const NewDateAgo = new Date(); NewDateAgo.setDate(NewDateAgo.getDate() - 3); @@ -978,7 +976,7 @@ function ChooseRibbon(item) { return '
Custom
'; } else if (item.ribbon === 'unknown') { return '
?
'; - } else if (item.ribbon === 'retro' && (Avatar.items.indexOf(item.id) !== -1 || Avatar.tool === item.id)) { + } else if (item.ribbon === 'retro' && wearing === true) { return '
Retro
'; } else if (item.isLimited) { return '
';