diff options
| author | Fuwn <[email protected]> | 2024-01-07 21:59:12 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-07 21:59:12 -0800 |
| commit | f9981283ae521c697a9ac78a42038ead460b7dbb (patch) | |
| tree | da6c4c072ee28177e15e5ee61516fddcbf688fb8 | |
| parent | refactor(wrapped): optional authorisation (diff) | |
| download | due.moe-f9981283ae521c697a9ac78a42038ead460b7dbb.tar.xz due.moe-f9981283ae521c697a9ac78a42038ead460b7dbb.zip | |
feat(manga): unreachable warning
| -rw-r--r-- | src/lib/List/Manga/CleanMangaList.svelte | 59 | ||||
| -rw-r--r-- | src/lib/List/Manga/MangaListTemplate.svelte | 2 |
2 files changed, 43 insertions, 18 deletions
diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte index 396ac38c..e484bde1 100644 --- a/src/lib/List/Manga/CleanMangaList.svelte +++ b/src/lib/List/Manga/CleanMangaList.svelte @@ -13,6 +13,9 @@ onMouseMove, type HoverCoverResponse } from '$lib/Media/Cover/hoverCover'; + import { onMount } from 'svelte'; + import proxy from '$lib/Utility/proxy'; + import Loading from '$lib/Loading.svelte'; export let media: Media[]; export let cleanCache: () => void; @@ -29,6 +32,9 @@ export let authorised: boolean; let hoverCoverState: HoverCoverResponse = {}; + let serviceStatusResponse: Promise<Response>; + + onMount(() => (serviceStatusResponse = fetch(proxy('https://mangadex.org')))); </script> {#if authorised} @@ -43,27 +49,46 @@ {/if} {#if rateLimited} - <Error /> + {#await serviceStatusResponse} + <Loading type="service status" percent={33} card={false} /> + {:then status} + {#if status} + {#if status.status === 503} + <a href="https://due.moe">due.moe</a>'s manga data source is currently down for maintenance. + Please check back later. + {:else if status.status !== 200} + <a href="https://due.moe">due.moe</a>'s manga data source is currently unavailable. Please + check back later. + {:else} + <Error /> + {/if} + {:else} + <Loading type="service status" percent={66} card={false} /> + {/if} + {:catch} + <a href="https://due.moe">due.moe</a>'s manga data source is currently unreachable. Please check + back later. + {/await} {/if} {#if media.length === 0} - <ul> - <li> - <p> - No manga to display. <button on:click={cleanCache} data-umami-event="Force Refresh No Manga" - >Force refresh</button - > - </p> + {#if rateLimited} + <p /> + {/if} - <p> - Don't read manga? <button - on:click={() => ($settings.disableManga = true)} - data-umami-event="Disable No Manga">Hide the manga panel</button - > - You can re-enable it later in the <a href="/settings">Settings</a>. - </p> - </li> - </ul> + <p> + No manga to display. <button on:click={cleanCache} data-umami-event="Force Refresh No Manga" + >Force refresh</button + > + </p> + + <span> + Don't read manga? <button + on:click={() => ($settings.disableManga = true)} + data-umami-event="Disable No Manga">Hide the manga panel</button + > + You can re-enable it later in the <a href="/settings">Settings</a>. + </span> {/if} <ul> diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte index 0cec40e9..538633f4 100644 --- a/src/lib/List/Manga/MangaListTemplate.svelte +++ b/src/lib/List/Manga/MangaListTemplate.svelte @@ -269,6 +269,6 @@ <ListTitle count={-1337} time={0} /> {/if} - <Error /> + <Error list={false} /> {/await} {/await} |