From c6973dd8271028a5399b91cbed0b547e664764a1 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 15 Apr 2026 01:04:39 +0000 Subject: feat(command-palette): add clear anime and manga list caches action --- src/lib/CommandPalette/actions.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/lib/CommandPalette') 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", + }), + ); + }, + }, ]; -- cgit v1.2.3