diff options
| author | Fuwn <[email protected]> | 2023-08-27 22:35:34 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-08-27 22:35:34 -0700 |
| commit | d1f050f1b89d3428a17c0601e4f65f2e87188302 (patch) | |
| tree | 4b5200d094564f700231c51546c05750c4bd2f9a /src | |
| parent | feat(settings): rounding info text (diff) | |
| download | due.moe-d1f050f1b89d3428a17c0601e4f65f2e87188302.tar.xz due.moe-d1f050f1b89d3428a17c0601e4f65f2e87188302.zip | |
feat(settings): add reset settings
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/settings/+page.svelte | 19 | ||||
| -rw-r--r-- | src/stores/cacheMangaMinutes.ts | 2 | ||||
| -rw-r--r-- | src/stores/roundDownChapters.ts | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index f68306ab..087cc445 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -24,6 +24,15 @@ await chapterDatabase.chapters.bulkDelete(ids); }; + const resetSettings = () => { + displayUnresolved.set('false'); + roundDownChapters.set('true'); + closeAnimeByDefault.set('false'); + closeMangaByDefault.set('false'); + sortByDifference.set('true'); + cacheMinutes.set('30'); + cacheMangaMinutes.set('60'); + }; </script> <a href="/">Home</a> @@ -52,7 +61,7 @@ $roundDownChapters === 'true' ? roundDownChapters.set('false') : roundDownChapters.set('true')} - >{$roundDownChapters === 'true' ? 'Round down' : 'Maintain'} chapters</a + >{$roundDownChapters === 'false' ? 'Round down' : 'Maintain'} chapters</a > <small style="opacity: 50%;" >50/50.6 would {@html $roundDownChapters === 'true' ? '<b>not</b>' : ''} be due</small @@ -106,5 +115,13 @@ ></small > </li> + <li> + <a href="#" on:click={resetSettings}>Reset <b>ALL</b> settings</a> + </li> + <li> + <a href="#" on:click={() => localStorage.clear()}>Clear <code>localStorage</code> </a> + <small style="opacity: 50%;">Doesn't break anything, but resets all settings and caches</small + > + </li> </ul> {/if} diff --git a/src/stores/cacheMangaMinutes.ts b/src/stores/cacheMangaMinutes.ts index f4c714ad..6da460b2 100644 --- a/src/stores/cacheMangaMinutes.ts +++ b/src/stores/cacheMangaMinutes.ts @@ -2,7 +2,7 @@ import { browser } from '$app/environment'; import { writable } from 'svelte/store'; const cacheMangaMinutes = writable<string>( - browser ? localStorage.getItem('cacheMangaMinutes') ?? '120' : '120' + browser ? localStorage.getItem('cacheMangaMinutes') ?? '60' : '60' ); cacheMangaMinutes.subscribe((value) => { diff --git a/src/stores/roundDownChapters.ts b/src/stores/roundDownChapters.ts index f4ac3513..8cbdbdc1 100644 --- a/src/stores/roundDownChapters.ts +++ b/src/stores/roundDownChapters.ts @@ -2,7 +2,7 @@ import { browser } from '$app/environment'; import { writable } from 'svelte/store'; const roundDownChapters = writable<string>( - browser ? localStorage.getItem('roundDownChapters') ?? 'false' : 'false' + browser ? localStorage.getItem('roundDownChapters') ?? 'true' : 'true' ); roundDownChapters.subscribe((value) => { |