diff options
| author | Fuwn <[email protected]> | 2026-04-15 01:18:00 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-15 01:18:00 +0000 |
| commit | d06a7a9bb689849b2b7beced2606ceb98513f4bb (patch) | |
| tree | 8f54fc3fa12c70b21bf4bf421608c9b9400064da /src/lib/Settings | |
| parent | feat(command-palette): add clear anime and manga list caches action (diff) | |
| download | due.moe-d06a7a9bb689849b2b7beced2606ceb98513f4bb.tar.xz due.moe-d06a7a9bb689849b2b7beced2606ceb98513f4bb.zip | |
feat(cache): instant list revalidation from command palette and debug menu
Replaces one-shot boolean revalidateAnime with a counter store so
multiple components can subscribe without race conditions. Adds
revalidateManga store and reactive refresh blocks to DueAnimeList
and MangaListTemplate. Extracts shared invalidateListCaches function
used by both the command palette action and the debug settings button.
Renames palette item to "Refresh" and debug button to "Invalidate".
Diffstat (limited to 'src/lib/Settings')
| -rw-r--r-- | src/lib/Settings/Categories/Debug.svelte | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/lib/Settings/Categories/Debug.svelte b/src/lib/Settings/Categories/Debug.svelte index c6b16086..ad388fee 100644 --- a/src/lib/Settings/Categories/Debug.svelte +++ b/src/lib/Settings/Categories/Debug.svelte @@ -7,19 +7,7 @@ import { options } from "$lib/Notification/options"; import locale from "$stores/locale"; import SettingCheckboxToggle from "../SettingCheckboxToggle.svelte"; import localforage from "localforage"; -import { browser } from "$app/environment"; - -const clearCaches = async () => { - if (!browser) return; - - await localforage.removeItem("anime"); - await localforage.removeItem("manga"); - addNotification( - options({ - heading: "Anime and manga list caches successfully cleared", - }), - ); -}; +import { invalidateListCaches } from "$lib/Media/invalidate"; </script> <SettingCheckboxToggle setting="debugDummyLists" text={$locale().debug.dummyLists} /> @@ -29,7 +17,7 @@ const clearCaches = async () => { /> <br /> -<button onclick={clearCaches}>{$locale().debug.clearCaches}</button> +<button onclick={invalidateListCaches}>{$locale().debug.clearCaches}</button> <Spacer /> |