From 8bdaf94d9dd0582315eeedb3d04210d3fd3acfa6 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 27 Aug 2023 22:06:13 -0700
Subject: feat(anime): allow sort by days left

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

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

diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte
index f50208b5..874d3804 100644
--- a/src/routes/settings/+page.svelte
+++ b/src/routes/settings/+page.svelte
@@ -6,6 +6,7 @@
 	import cacheMangaMinutes from '../../stores/cacheMangaMinutes';
 	import cacheMinutes from '../../stores/cacheMinutes';
 	import roundDownChapters from '../../stores/roundDownChapters';
+	import sortByDifference from '../../stores/sortByDifference';
 
 	export let data;
 
@@ -73,6 +74,18 @@
 				>{mangaClosed ? 'Expand' : 'Close'} manga panel by default</a
 			>
 		</li>
+		<li>
+			<a
+				href="#"
+				on:click={() =>
+					$sortByDifference === 'true'
+						? sortByDifference.set('false')
+						: sortByDifference.set('true')}
+				>Sort anime by {@html $sortByDifference === 'true'
+					? 'difference between last watched and next episode'
+					: 'days left until next episode'}</a
+			>
+		</li>
 		<li>
 			<a href="#" on:click={pruneUnresolved}>Re-cache <b>ALL</b> unresolved manga</a>
 		</li>
-- 
cgit v1.2.3

