From 08363f7161387547606046fe7f48b31099cf75ea Mon Sep 17 00:00:00 2001 From: kiosion Date: Sun, 24 Sep 2023 20:14:02 -0300 Subject: [PATCH] fix: Lang toggle --- .../components/controls/language-toggle.svelte | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/svelte-app/src/components/controls/language-toggle.svelte b/svelte-app/src/components/controls/language-toggle.svelte index 641112215..73ba7931e 100644 --- a/svelte-app/src/components/controls/language-toggle.svelte +++ b/svelte-app/src/components/controls/language-toggle.svelte @@ -9,18 +9,14 @@ import Icon from '$components/icon.svelte'; import Tooltip from '$components/tooltip.svelte'; - const handleClick = (event: Event, lang: string) => { + const handleClick = (event: Event, lang: (typeof APP_LANGS)[number]) => { event.preventDefault(); if ($page?.url?.pathname?.startsWith(`/${lang}`)) { return; } goto( - $linkTo( - `${$page.url.pathname}${$page.url.hash}`, - $page.url.searchParams, - APP_LANGS[1] - ), + $linkTo(`${$page.url.pathname}${$page.url.hash}`, $page.url.searchParams, lang), { invalidateAll: true, replaceState: true @@ -33,17 +29,19 @@