From ae7057463a2447a2a15c746b4aefe2586a9b26ed Mon Sep 17 00:00:00 2001 From: Zachary Date: Tue, 12 Nov 2024 09:53:12 +0100 Subject: [PATCH] Fix country selection --- src/routes/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index eaeac77..6010291 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -63,8 +63,8 @@ try { const response = await fetch('/cdn-cgi/trace'); const text = await response.text(); - const countryCodeMatch = text.match(/cf-ipcountry=(\w+)/); - const countryCode = countryCodeMatch ? countryCodeMatch[1] : 'BE'; + const countryCodeMatch = text.match(/loc=(\w+)/); + const countryCode = countryCodeMatch ? countryCodeMatch[1] : ''; selectedCountry = countriesList[countryCode] || ''; daysOff = ptoData[countryCode] || 0; } catch (error) {