aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List/WatchingAnimeList.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/List/WatchingAnimeList.svelte')
-rw-r--r--src/lib/List/WatchingAnimeList.svelte29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/lib/List/WatchingAnimeList.svelte b/src/lib/List/WatchingAnimeList.svelte
index f22d80df..e76b1ef0 100644
--- a/src/lib/List/WatchingAnimeList.svelte
+++ b/src/lib/List/WatchingAnimeList.svelte
@@ -7,7 +7,7 @@
import anime from '../../stores/anime';
import lastPruneTimes from '../../stores/lastPruneTimes';
import settings from '../../stores/settings';
- import { totalEpisodes } from '$lib/anime';
+ import { cleanCache, totalEpisodes } from '$lib/anime';
export let user: AniListAuthorisation;
export let identity: UserIdentity;
@@ -62,27 +62,9 @@
const updateMedia = async (id: number, progress: number | undefined) => {
fetch(`/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(() => {
- animeLists = mediaListCollection(
- user,
- identity,
- Type.Anime,
- $anime,
- $lastPruneTimes.anime,
- true
- );
+ animeLists = cleanCache(user, identity);
});
};
-
- const cleanCache = () => {
- animeLists = mediaListCollection(
- user,
- identity,
- Type.Anime,
- $anime,
- $lastPruneTimes.anime,
- true
- );
- };
</script>
{#await animeLists}
@@ -99,7 +81,12 @@
{#if cleanedMedia.length === 0}
<ul>
- <li>No anime to display. <a href={'#'} on:click={cleanCache}>Force refresh</a></li>
+ <li>
+ No anime to display. <a
+ href={'#'}
+ on:click={() => (animeLists = cleanCache(user, identity))}>Force refresh</a
+ >
+ </li>
</ul>
{/if}