aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-28 18:58:00 -0800
committerFuwn <[email protected]>2024-01-28 18:58:00 -0800
commit950155bbeae847595faf4c0da0466540b843a3e8 (patch)
tree14d5d2315d867557d3476869ac229436ea769c72 /src
parentfeat(html): static css (diff)
downloaddue.moe-950155bbeae847595faf4c0da0466540b843a3e8.tar.xz
due.moe-950155bbeae847595faf4c0da0466540b843a3e8.zip
feat(badges): rate limited message
Diffstat (limited to 'src')
-rw-r--r--src/lib/Error/RateLimited.svelte21
-rw-r--r--src/routes/user/[user]/badges/+page.svelte9
2 files changed, 22 insertions, 8 deletions
diff --git a/src/lib/Error/RateLimited.svelte b/src/lib/Error/RateLimited.svelte
index b00bbd11..bdddc3c0 100644
--- a/src/lib/Error/RateLimited.svelte
+++ b/src/lib/Error/RateLimited.svelte
@@ -4,6 +4,7 @@
export let contact = true;
export let list = true;
export let card = false;
+ export let might = true;
</script>
<div class:card>
@@ -11,8 +12,10 @@
<ul>
<li>
<p>
- {type} could not be loaded. You might have been
- <a href="https://en.wikipedia.org/wiki/Rate_limiting" target="_blank">rate limited</a>.
+ {type} could not be loaded. You{might ? ' might' : ''} have been
+ <a href="https://en.wikipedia.org/wiki/Rate_limiting" target="_blank">rate limited</a>. {#if !might}
+ Try again in one minute.
+ {/if}
</p>
{#if loginSessionError}
@@ -24,9 +27,9 @@
<slot />
- <p />
-
{#if contact}
+ <p />
+
If the problem persists, please contact
<a href="https://anilist.co/user/fuwn" target="_blank">@fuwn</a> on AniList.
{/if}
@@ -34,8 +37,10 @@
</ul>
{:else}
<p>
- {type} could not be loaded. You might have been
- <a href="https://en.wikipedia.org/wiki/Rate_limiting" target="_blank">rate limited</a>.
+ {type} could not be loaded. You{might ? ' might' : ''} have been
+ <a href="https://en.wikipedia.org/wiki/Rate_limiting" target="_blank">rate limited</a>. {#if !might}
+ Try again in one minute.
+ {/if}
</p>
{#if loginSessionError}
@@ -47,9 +52,9 @@
<slot />
- <p />
-
{#if contact}
+ <p />
+
If the problem persists, please contact
<a href="https://anilist.co/user/fuwn" target="_blank">@fuwn</a> on AniList.
{/if}
diff --git a/src/routes/user/[user]/badges/+page.svelte b/src/routes/user/[user]/badges/+page.svelte
index e41d294c..551efaf5 100644
--- a/src/routes/user/[user]/badges/+page.svelte
+++ b/src/routes/user/[user]/badges/+page.svelte
@@ -12,6 +12,7 @@
import cdn from '$lib/Utility/cdn.js';
import locale from '$stores/locale.js';
import Skeleton from '$lib/Skeleton.svelte';
+ import RateLimited from '$lib/Error/RateLimited.svelte';
// import { io } from 'socket.io-client';
export let data;
@@ -519,6 +520,14 @@
{:catch}
<div class="card">Could not fetch badges</div>
{/await}
+ {:catch}
+ <RateLimited
+ type="Profile"
+ list={false}
+ might={false}
+ loginSessionError={false}
+ contact={false}
+ />
{/await}
{/if}