diff options
Diffstat (limited to 'src/lib/CommandPalette/actions.ts')
| -rw-r--r-- | src/lib/CommandPalette/actions.ts | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/lib/CommandPalette/actions.ts b/src/lib/CommandPalette/actions.ts index 48603504..9915fe66 100644 --- a/src/lib/CommandPalette/actions.ts +++ b/src/lib/CommandPalette/actions.ts @@ -1,7 +1,4 @@ -import { browser } from "$app/environment"; -import localforage from "localforage"; -import { addNotification } from "$lib/Notification/store"; -import { options } from "$lib/Notification/options"; +import { invalidateListCaches } from "$lib/Media/invalidate"; export interface CommandPaletteAction { name: string; @@ -171,21 +168,19 @@ export const defaultActions: CommandPaletteAction[] = [ tags: ["user", "me", "settings"], }, { - name: "Clear Anime & Manga List Caches", + name: "Refresh 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", - }), - ); - }, + tags: [ + "cache", + "clear", + "refresh", + "invalidate", + "debug", + "anime", + "manga", + "list", + ], + onClick: invalidateListCaches, }, ]; |