From 990f614fad2659fe94d29807dc06d279b742b8f3 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 4 Jan 2024 10:14:56 -0800
Subject: fix(schedule): remove empty days

---
 src/lib/Tools/Schedule/Tool.svelte | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/lib/Tools/Schedule/Tool.svelte')

diff --git a/src/lib/Tools/Schedule/Tool.svelte b/src/lib/Tools/Schedule/Tool.svelte
index f32aa788..f000bfbc 100644
--- a/src/lib/Tools/Schedule/Tool.svelte
+++ b/src/lib/Tools/Schedule/Tool.svelte
@@ -55,11 +55,18 @@
 			.concat(days.slice(0, currentDayIndex))
 			.forEach((day) => {
 				const scheduleEntry = schedule[day as keyof typeof schedule];
+
 				shiftedSchedule[day] = Array.isArray(scheduleEntry)
 					? scheduleEntry
 					: ([scheduleEntry] as unknown as SubsPleaseEpisode[]);
 			});
 
+		Object.entries(shiftedSchedule).forEach(([day, scheduleEntry]) => {
+			if (scheduleEntry.length === 0) {
+				delete shiftedSchedule[day];
+			}
+		});
+
 		return shiftedSchedule;
 	};
 
-- 
cgit v1.2.3

