diff options
| author | Fuwn <[email protected]> | 2024-01-11 19:07:14 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-11 19:07:14 -0800 |
| commit | 74fe5f91e2cd4e4d29b795e1360c05b1ff62a53c (patch) | |
| tree | ae0599eee0073269d2955b660baa6fed84dc59c7 /src/lib | |
| parent | feat: notifications (diff) | |
| download | due.moe-74fe5f91e2cd4e4d29b795e1360c05b1ff62a53c.tar.xz due.moe-74fe5f91e2cd4e4d29b795e1360c05b1ff62a53c.zip | |
feat(list): list notifications
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/List/Anime/DueAnimeList.svelte | 10 | ||||
| -rw-r--r-- | src/lib/List/Manga/MangaListTemplate.svelte | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/List/Anime/DueAnimeList.svelte b/src/lib/List/Anime/DueAnimeList.svelte index 3e540cc5..750d773b 100644 --- a/src/lib/List/Anime/DueAnimeList.svelte +++ b/src/lib/List/Anime/DueAnimeList.svelte @@ -8,10 +8,13 @@ import AnimeList from './AnimeListTemplate.svelte'; import type { SubsPlease } from '$lib/Media/Anime/Airing/Subtitled/subsPlease'; import { injectAiringTime } from '$lib/Media/Anime/Airing/Subtitled/match'; + import { options } from '$lib/Notification/options'; + import { getNotificationsContext } from 'svelte-notifications'; export let user: AniListAuthorisation; export let identity: UserIdentity; + const { addNotification } = getNotificationsContext(); let animeLists: Promise<Media[]>; let startTime: number; let endTime: number; @@ -22,6 +25,13 @@ animeLists = mediaListCollection(user, identity, Type.Anime, $anime, $lastPruneTimes.anime, { forcePrune: true }); + + addNotification( + options({ + heading: 'Anime', + description: 'Re-cached from AniList' + }) + ); }, $settings.cacheMinutes * 1000 * 60); onMount(async () => { diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte index 538633f4..97f020be 100644 --- a/src/lib/List/Manga/MangaListTemplate.svelte +++ b/src/lib/List/Manga/MangaListTemplate.svelte @@ -13,12 +13,15 @@ import CleanMangaList from './CleanMangaList.svelte'; import authorisedJson from '$lib/authorised.json'; import { incrementMediaProgress } from '$lib/Media/Anime/cache'; + import { getNotificationsContext } from 'svelte-notifications'; + import { options } from '$lib/Notification/options'; export let user: AniListAuthorisation; export let identity: UserIdentity; export let displayUnresolved: boolean; export let due: boolean; + const { addNotification } = getNotificationsContext(); const authorised = authorisedJson.includes(identity.id); let mangaLists: Promise<Media[]>; let startTime: number; @@ -34,6 +37,13 @@ startTime = performance.now(); endTime = -1; mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $lastPruneTimes.manga); + + addNotification( + options({ + heading: 'Manga', + description: 'Re-cached media lists from AniList' + }) + ); }, $settings.cacheMinutes * 1000 * 60); onMount(async () => { |