From 68776ac3b02726b1480e879743d76d2d2b525e89 Mon Sep 17 00:00:00 2001 From: KittenTM Date: Sat, 21 Mar 2026 04:09:18 +0100 Subject: [PATCH] fix: equipment: Remove broken ass page when any values return null --- equipment/equipment.js | 27 ++++++++++++++++++++++----- equipment/styles.css | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/equipment/equipment.js b/equipment/equipment.js index 44f5dfe..25c882a 100644 --- a/equipment/equipment.js +++ b/equipment/equipment.js @@ -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 = ` +
+

+ 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!

+ + Note: if this service does not support Cemu due to how the emulator does not support POST requests. +

+
`; + } + } 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); diff --git a/equipment/styles.css b/equipment/styles.css index 00b2368..451b10b 100644 --- a/equipment/styles.css +++ b/equipment/styles.css @@ -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;