From 1b5ba69b9aa74e0f68dcfb48fcdaca3908a6f1a6 Mon Sep 17 00:00:00 2001 From: Zachary Date: Mon, 11 Nov 2024 23:23:36 +0100 Subject: [PATCH] Update localstorage on first load --- src/routes/+page.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index efa567a..0d5f3ea 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -31,6 +31,9 @@ if (storedCountry) selectedCountry = storedCountry; if (storedDaysOff) daysOff = parseInt(storedDaysOff); + // Ensure holidays are updated after loading settings + updateHolidays(); + fetchCountryCode(); adjustInputWidth(inputElement); inputElement.addEventListener('input', () => { @@ -73,6 +76,7 @@ } if (typeof window !== 'undefined') { // Check if running in the browser localStorage.setItem('year', year); // Save to local storage + localStorage.setItem('daysOff', daysOff); // Save to local storage } }