mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 01:07:28 +08:00
AquaNet: Added an Error Message trigger to pages that didn't telegraph to the user that there was an error before.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import 'chartjs-adapter-moment';
|
||||
import { DATA, GAME } from "../libs/sdk";
|
||||
import { type GameName, getMult } from "../libs/scoring";
|
||||
import ErrorMessage from "../ErrorMessage.svelte";
|
||||
|
||||
registerChart()
|
||||
|
||||
@@ -15,7 +16,7 @@
|
||||
export let game: GameName
|
||||
game = game || "mai2"
|
||||
let calElement: HTMLElement
|
||||
|
||||
let ifError = null
|
||||
title(`User ${username}`)
|
||||
|
||||
interface MusicAndPlay extends MusicMeta, GenericGamePlaylog {}
|
||||
@@ -38,7 +39,9 @@
|
||||
d = {user, trend, recent: user.recent.map(it => {return {...music[it.musicId], ...it}})}
|
||||
localStorage.setItem("tmp-user-details", JSON.stringify(d))
|
||||
renderCal(calElement, trend.map(it => {return {date: it.date, value: it.plays}}))
|
||||
})
|
||||
}).catch((error) => {
|
||||
ifError = error;
|
||||
});
|
||||
|
||||
const pfpNotFound = (e: Event) => {
|
||||
(e.target as HTMLImageElement).src = "/assets/imgs/no_profile.png"
|
||||
@@ -191,7 +194,9 @@
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{:else if ifError}
|
||||
<ErrorMessage {ifError}/>
|
||||
{:else}
|
||||
<p>Loading...</p>
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user