diff options
| author | Fuwn <[email protected]> | 2024-01-11 18:45:31 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-11 18:45:31 -0800 |
| commit | 1b71b6a1197967271528fd0d5b9ff5fc9a1f3c26 (patch) | |
| tree | 5261f5d00e22b53e89420c3c1b5fa97d60253d6e /src/lib/Settings | |
| parent | refactor(routes): move shortcuts to hooks (diff) | |
| download | due.moe-1b71b6a1197967271528fd0d5b9ff5fc9a1f3c26.tar.xz due.moe-1b71b6a1197967271528fd0d5b9ff5fc9a1f3c26.zip | |
feat: notifications
Diffstat (limited to 'src/lib/Settings')
| -rw-r--r-- | src/lib/Settings/Categories/Debug.svelte | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/lib/Settings/Categories/Debug.svelte b/src/lib/Settings/Categories/Debug.svelte index 5f6be96b..c21b6dd7 100644 --- a/src/lib/Settings/Categories/Debug.svelte +++ b/src/lib/Settings/Categories/Debug.svelte @@ -1,16 +1,38 @@ <script lang="ts"> import settings from '$stores/settings'; + import { getNotificationsContext } from 'svelte-notifications'; import SettingHint from '../SettingHint.svelte'; + import { options } from '$lib/Notification/options'; + + const { addNotification } = getNotificationsContext(); </script> -<button on:click={settings.reset}>Reset <b>ALL</b> settings</button> +<button + on:click={() => { + settings.reset(); + addNotification( + options({ + heading: 'All settings successfully reset' + }) + ); + }}>Reset <b>ALL</b> settings</button +> <SettingHint lineBreak> Resets all settings present on this page to their default values </SettingHint> <p /> -<button on:click={() => localStorage.clear()}>Clear <code>localStorage</code></button> +<button + on:click={() => { + localStorage.clear(); + addNotification( + options({ + heading: '<code>localStorage</code> successfully cleared' + }) + ); + }}>Clear <code>localStorage</code></button +> <SettingHint lineBreak> Resets all of your settings to their default values and clears both AniList media list and manga data caches |