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:
Galexion
2024-02-29 22:48:41 -05:00
parent 88b7804123
commit c4309aa14c
5 changed files with 45 additions and 16 deletions

View File

@@ -3,9 +3,11 @@
import {getMaimaiAllMusic, getMaimai} from "../libs/maimai";
import type {ParsedRating, Rating} from "../libs/maimaiTypes";
import { getMult } from "../libs/scoring";
import ErrorMessage from "../ErrorMessage.svelte";
export let userId: any
userId = +userId
let ifError = null;
if (!userId) console.error("No user ID provided")
@@ -25,6 +27,8 @@
old: parseRating(data.userRating.ratingList),
new: parseRating(data.userRating.newRatingList)
}
}).catch((error) => {
ifError = error
})
function parseRating(arr: Rating[]) {
@@ -91,7 +95,10 @@
{/each}
</div>
{/each}
{/if}
{:else if ifError}
<ErrorMessage {ifError}/>
{/if}
</main>
<style lang="sass">