From cfc0dcac09a868f8be9f687e63c934d27fb1ff87 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 29 Aug 2023 13:43:04 -0700
Subject: fix(manga): more reliable cache clear

---
 src/lib/List/Due/MangaList.svelte | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/lib/List/Due/MangaList.svelte')

diff --git a/src/lib/List/Due/MangaList.svelte b/src/lib/List/Due/MangaList.svelte
index 3e0a956d..7a3bc68c 100644
--- a/src/lib/List/Due/MangaList.svelte
+++ b/src/lib/List/Due/MangaList.svelte
@@ -94,11 +94,11 @@
 
 	const updateMedia = async (id: number, progress: number | undefined) => {
 		manga.set('');
-		await chapterDatabase.chapters.delete(id);
+		chapterDatabase.chapters.delete(id).then(async () => {
+			mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $mangaLastPrune);
 
-		mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $mangaLastPrune);
-
-		await fetch(`/anilist/increment?id=${id}&progress=${progress! + 1}`);
+			await fetch(`/anilist/increment?id=${id}&progress=${progress! + 1}`);
+		});
 	};
 </script>
 
-- 
cgit v1.2.3

