fix: equipment: Remove broken ass page when any values return null

This commit is contained in:
kittentm 2026-03-21 04:09:18 +01:00
commit 68776ac3b0
No known key found for this signature in database
GPG key ID: AC43DFDBC1F44A91
2 changed files with 40 additions and 5 deletions

View file

@ -253,11 +253,28 @@ window.loadHeader(async function(headerContainer) {
handleFetch("/api/v1/me/equipment"),
handleFetch("/api/v1/me/equipment/history")
]);
await renderData(profileRes, false);
await renderData(equipRes, false);
await renderData({ history: Array.isArray(historyRes) ? historyRes : [] }, false);
sessionStorage.setItem('user_cache', JSON.stringify(combinedData));
const hasNullFields = !equipRes || Object.values(equipRes).some(v => v === null);
if (hasNullFields) {
await renderData(profileRes, false);
if (infoBox) {
infoBox.innerHTML = `
<div class="info-message-box">
<p>
To use this service, it is required for you to play at least one game on Splatfestival Network.
Play a match on your Wii U on Splatoon!<br><br>
Note: if this service does not support Cemu due to how the emulator does not support POST requests.
</p>
</div>`;
}
} else {
await renderData(profileRes, false);
await renderData(equipRes, false);
await renderData({ history: Array.isArray(historyRes) ? historyRes : [] }, false);
sessionStorage.setItem('user_cache', JSON.stringify(combinedData));
}
} catch (err) {
if (cacheFound) {
await renderData(sessionStorage.getItem('user_cache'), true);

View file

@ -164,6 +164,24 @@ body {
align-items: center;
}
.info-message-box {
background-color: rgba(0, 0, 0, 0.6);
border-radius: 10px;
padding: 25px 40px;
max-width: 700px;
margin: 40px auto;
box-sizing: border-box;
}
.info-message-box p {
color: #ffffff;
font-family: "Regular", sans-serif;
font-size: 20px;
line-height: 1.6;
margin: 0;
text-align: left;
}
#scale-root {
width: 1044px;
height: 600px;