diff options
| author | Fuwn <[email protected]> | 2026-04-17 15:05:11 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-17 15:05:11 +0000 |
| commit | e646bbb16e85d21585d12daf76aac95a5c7ffac2 (patch) | |
| tree | 1869c225980b4cff5a2b2ddf2263f5a947fbc62f | |
| parent | fix(ui): hide follow-fix toggle link until a username is entered (diff) | |
| download | due.moe-e646bbb16e85d21585d12daf76aac95a5c7ffac2.tar.xz due.moe-e646bbb16e85d21585d12daf76aac95a5c7ffac2.zip | |
fix(ui): reset media list filter when its custom list disappears
If a user's persisted filter references a custom list that no longer
exists on any media (renamed or deleted on AniList), the select falls
back to showing "All" but the underlying state still filters to an
empty set. Detect the stale value and reset it, clearing the StateBin
entry so the fix survives a reload.
| -rw-r--r-- | src/lib/List/Anime/CleanAnimeList.svelte | 10 | ||||
| -rw-r--r-- | src/lib/List/Manga/CleanMangaList.svelte | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte index e6aa7a5d..064b0fc5 100644 --- a/src/lib/List/Anime/CleanAnimeList.svelte +++ b/src/lib/List/Anime/CleanAnimeList.svelte @@ -94,6 +94,16 @@ $: hasDistinguishingList = lists.some((list) => media.some((m) => !m.mediaListEntry?.customLists?.[list]), ); +$: if ( + lists.length > 0 && + selectedList !== "All" && + !lists.includes(selectedList) +) { + selectedList = "All"; + + if (!disableFilter) $stateBin[filterKey] = "All"; +} + $: filteredMedia = selectedList === "All" || !$settings.displayMediaListFilter ? media diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte index 7907c22f..9f24bbdd 100644 --- a/src/lib/List/Manga/CleanMangaList.svelte +++ b/src/lib/List/Manga/CleanMangaList.svelte @@ -87,6 +87,16 @@ $: hasDistinguishingList = lists.some((list) => media.some((m) => !m.mediaListEntry?.customLists?.[list]), ); +$: if ( + lists.length > 0 && + selectedList !== "All" && + !lists.includes(selectedList) +) { + selectedList = "All"; + + if (!disableFilter) $stateBin[filterKey] = "All"; +} + $: filteredMedia = selectedList === "All" || !$settings.displayMediaListFilter ? media |