From 38f12c0dcb9696d00aba47812aa700e7d37a20d6 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 17 Mar 2024 05:28:09 -0700
Subject: feat(umamusume): single fetch birthdays

---
 src/lib/Tools/UmaMusumeBirthdays.svelte | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'src/lib/Tools/UmaMusumeBirthdays.svelte')

diff --git a/src/lib/Tools/UmaMusumeBirthdays.svelte b/src/lib/Tools/UmaMusumeBirthdays.svelte
index 8a8e33db..faf962f8 100644
--- a/src/lib/Tools/UmaMusumeBirthdays.svelte
+++ b/src/lib/Tools/UmaMusumeBirthdays.svelte
@@ -33,9 +33,6 @@
 		day = Math.min(day, new Date(new Date().getFullYear(), month, 0).getDate());
 		day = Math.max(day, 1);
 
-		if (browser)
-			umapyoi = fetch('https://umapyoi.net/api/v1/character/birthday').then((r) => r.json());
-
 		if (browser) {
 			$page.url.searchParams.set('month', month.toString());
 			$page.url.searchParams.set('day', day.toString());
@@ -44,7 +41,11 @@
 		}
 	}
 
-	onMount(() => clearAllParameters(['month', 'day']));
+	onMount(() => {
+		clearAllParameters(['month', 'day']);
+
+		umapyoi = fetch('https://umapyoi.net/api/v1/character/birthday').then((r) => r.json());
+	});
 </script>
 
 {#await umapyoi}
-- 
cgit v1.2.3

