diff options
| author | Fuwn <[email protected]> | 2025-06-11 23:51:39 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-06-11 23:51:39 -0700 |
| commit | 11534bc271793cf408027603f885f299c1d39226 (patch) | |
| tree | ed87ad26dea06e298b8b4406402fda129e8684d8 /src/lib/Settings | |
| parent | refactor(stores): Generic persistent storage facility (diff) | |
| download | due.moe-11534bc271793cf408027603f885f299c1d39226.tar.xz due.moe-11534bc271793cf408027603f885f299c1d39226.zip | |
fix: Migrate localStorage.removeItem to localforage for anime and manga stores
Diffstat (limited to 'src/lib/Settings')
| -rw-r--r-- | src/lib/Settings/Categories/Debug.svelte | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/Settings/Categories/Debug.svelte b/src/lib/Settings/Categories/Debug.svelte index 79e18c03..8ba6ade9 100644 --- a/src/lib/Settings/Categories/Debug.svelte +++ b/src/lib/Settings/Categories/Debug.svelte @@ -5,23 +5,29 @@ 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 { addNotification } = getNotificationsContext(); -</script> -<SettingCheckboxToggle setting="debugDummyLists" text={$locale().debug.dummyLists} /> + const clearCaches = async () => { + if (!browser) return; -<button - on:click={() => { localStorage.removeItem('anime'); localStorage.removeItem('manga'); + await localforage.removeItem('anime'); + await localforage.removeItem('manga'); addNotification( options({ heading: 'Anime and manga list caches successfully cleared' }) ); - }}>{$locale().debug.clearCaches}</button -> + }; +</script> + +<SettingCheckboxToggle setting="debugDummyLists" text={$locale().debug.dummyLists} /> + +<button on:click={clearCaches}>{$locale().debug.clearCaches}</button> <p /> |