fix: display error in a friendlier way on rankings

migrate from status overlays to displaying within container
This commit is contained in:
Yonle
2026-05-16 09:39:54 +07:00
committed by GitHub
parent aec0fdac8b
commit 4895456bb0
2 changed files with 3 additions and 4 deletions

View File

@@ -3,7 +3,6 @@
import { title } from "../libs/ui";
import { GAME } from "../libs/sdk";
import type { GenericRanking } from "../libs/generalTypes";
import StatusOverlays from "../components/StatusOverlays.svelte";
import type { GameName } from "../libs/scoring";
import { GAME_TITLE } from "../libs/i18n";
import { t } from "../libs/i18n";
@@ -86,9 +85,9 @@
<Tooltip triggeredBy=".name" loading={hoverLoading}>
<UserCard username={hoveringUser} {game} setLoading={l => hoverLoading = l} />
</Tooltip>
{:else}
<p>{error}</p>
{/if}
<StatusOverlays error={error} loading={!loadedPages} />
</main>
<style lang="sass">

View File

@@ -57,7 +57,7 @@ abstract class GameApiController<T : IUserData>(val name: String, userDataClass:
val time = millis()
// Check cache validity
if (rankingCache.isEmpty()) (500 - "Ranking is computing... please wait")
if (rankingCache.isEmpty()) (500 - "Rank is empty or is currently computing. Please come back later.")
val reqUser = token?.let { us.jwt.auth(it) }?.let { u ->
// Optimization: If the user is not banned, we don't need to process user information