aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List/Manga/CleanMangaList.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/List/Manga/CleanMangaList.svelte')
-rw-r--r--src/lib/List/Manga/CleanMangaList.svelte16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte
index cacc7006..db5778da 100644
--- a/src/lib/List/Manga/CleanMangaList.svelte
+++ b/src/lib/List/Manga/CleanMangaList.svelte
@@ -47,7 +47,15 @@ let totalEpisodeDueCount = media
return (manga.episodes || 1) - (manga.mediaListEntry?.progress || 0);
})
.reduce((a, b) => a + b, 0);
-const lists = Array.from(
+let lists: string[] = [];
+const filterKind = due ? "due" : "completed";
+const filterKey = `${filterKind}MangaListFilter`;
+
+$: selectedList = disableFilter
+ ? "All"
+ : ($stateBin[filterKey] as string) || "All";
+
+$: lists = Array.from(
new Set(
media
.flatMap((m) => Object.entries(m.mediaListEntry?.customLists ?? {}))
@@ -55,12 +63,6 @@ const lists = Array.from(
.map(([key]) => key),
),
);
-const filterKind = due ? "due" : "completed";
-const filterKey = `${filterKind}MangaListFilter`;
-
-$: selectedList = disableFilter
- ? "All"
- : ($stateBin[filterKey] as string) || "All";
$: filteredMedia =
selectedList === "All" || !$settings.displayMediaListFilter