fix: fix avatar sandbox load user overwriting cache

This commit is contained in:
Index 2024-07-02 14:29:19 -05:00
parent 431ef7ee73
commit 3b0f079a2f

View file

@ -384,19 +384,21 @@ async function LoadUser(id) {
Avatar.items = []; Avatar.items = [];
data.assets.forEach((item) => { data.assets.forEach((item) => {
ItemCache[item.id] = { if (ItemCache[item.id] === undefined) {
type: item.type, ItemCache[item.id] = {
name: item.name, type: item.type,
price: null, name: item.name,
creator: null, price: null,
thumbnail: item.thumbnail, creator: null,
asset: item.path thumbnail: item.thumbnail,
} asset: item.path
}
if (item.type === 'hat' || item.type === 'tool') {
ItemCache[item.id].creator = { if (item.type === 'hat' || item.type === 'tool' || item.type === 'torso') {
id: 1, ItemCache[item.id].creator = {
name: "Polytoria" id: 1,
name: "Polytoria"
}
} }
} }