Modify way to get user luid

pull/42/head
alexay7 2024-07-28 03:45:22 +02:00
parent ec1155b1ba
commit bca5130020
1 changed files with 7 additions and 11 deletions

View File

@ -154,14 +154,8 @@
}); });
} }
async function fetchData(card: string) { async function fetchData() {
const userId = await USERBOX.getAimeId(card); const currentValues = await USERBOX.getProfile(aimeId).catch((e) => {
if (!userId) return;
aimeId = userId.luid;
const currentValues = await USERBOX.getProfile(userId.luid).catch((e) => {
loading = false; loading = false;
error = t("userbox.error.noprofile") error = t("userbox.error.noprofile")
return; return;
@ -195,7 +189,7 @@
await Promise.all( await Promise.all(
userBoxItems.map(async (kind) => { userBoxItems.map(async (kind) => {
// Populate info about the items // Populate info about the items
return USERBOX.getUnlockedItems(userId.luid, kind).then((items) => { return USERBOX.getUnlockedItems(aimeId, kind).then((items) => {
switch (kind) { switch (kind) {
case UserBoxItemKind.nameplate: case UserBoxItemKind.nameplate:
// Add the item id and the label to the available options // Add the item id and the label to the available options
@ -347,8 +341,10 @@
user = u; user = u;
const card = user.cards.length > 0 ? user.cards[0].luid : ""; const card = user.cards.length > 0 ? user.cards[0].luid : "";
if (card) { aimeId = card;
fetchData(card);
if (aimeId) {
fetchData();
} else { } else {
loading = false; loading = false;
} }