From d1f050f1b89d3428a17c0601e4f65f2e87188302 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 27 Aug 2023 22:35:34 -0700
Subject: feat(settings): add reset settings

---
 src/routes/settings/+page.svelte | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

(limited to 'src/routes/settings/+page.svelte')

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}
-- 
cgit v1.2.3

