diff options
| author | Fuwn <[email protected]> | 2026-04-15 01:04:39 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-15 01:04:39 +0000 |
| commit | c6973dd8271028a5399b91cbed0b547e664764a1 (patch) | |
| tree | 6024f2809e646707dc97598b208592ea59cf953d /src/lib | |
| parent | fix(ui): balance homepage media panels (diff) | |
| download | due.moe-c6973dd8271028a5399b91cbed0b547e664764a1.tar.xz due.moe-c6973dd8271028a5399b91cbed0b547e664764a1.zip | |
feat(command-palette): add clear anime and manga list caches action
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/CommandPalette/actions.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/CommandPalette/actions.ts b/src/lib/CommandPalette/actions.ts index 01259130..48603504 100644 --- a/src/lib/CommandPalette/actions.ts +++ b/src/lib/CommandPalette/actions.ts @@ -1,3 +1,8 @@ +import { browser } from "$app/environment"; +import localforage from "localforage"; +import { addNotification } from "$lib/Notification/store"; +import { options } from "$lib/Notification/options"; + export interface CommandPaletteAction { name: string; url: string; @@ -165,4 +170,22 @@ export const defaultActions: CommandPaletteAction[] = [ url: "/user?badges=1", tags: ["user", "me", "settings"], }, + { + name: "Clear Anime & Manga List Caches", + url: "", + preventDefault: true, + tags: ["cache", "clear", "refresh", "debug", "anime", "manga", "list"], + onClick: async () => { + if (!browser) return; + + await localforage.removeItem("anime"); + await localforage.removeItem("manga"); + + addNotification( + options({ + heading: "Anime and manga list caches successfully cleared", + }), + ); + }, + }, ]; |