aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Settings/Categories/Debug.svelte18
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 />