import { browser } from "$app/environment"; import { addNotification } from "$lib/Notification/store"; import { options } from "$lib/Notification/options"; import revalidateAnime from "$stores/revalidateAnime"; import revalidateManga from "$stores/revalidateManga"; import locale from "$stores/locale"; import { get } from "svelte/store"; export const invalidateListCaches = () => { if (!browser) return; revalidateAnime.update((n) => n + 1); revalidateManga.update((n) => n + 1); addNotification( options({ heading: get(locale)().notifications?.cacheInvalidated ?? "Anime and manga list caches successfully invalidated", }), ); };