From 07450eac95adcadd41c8971c1586e0d2f589c2b2 Mon Sep 17 00:00:00 2001 From: Darkmift Date: Sun, 19 May 2024 16:57:36 +0300 Subject: [PATCH] fix locale not remaining same in redirects --- components/Header/LocalSwitcher.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Header/LocalSwitcher.tsx b/components/Header/LocalSwitcher.tsx index 8a91755..c16ee68 100644 --- a/components/Header/LocalSwitcher.tsx +++ b/components/Header/LocalSwitcher.tsx @@ -6,6 +6,7 @@ import { usePathname, useRouter } from 'next/navigation'; import { SVGProps, useEffect, useRef, useState, useTransition } from 'react'; import FlagIL from '../SvgCmps/Flags/IL'; import FlagUS from '../SvgCmps/Flags/US'; +import local from 'next/font/local'; export default function LocalSwitcher() { const router = useRouter(); @@ -47,7 +48,8 @@ export default function LocalSwitcher() { setIsOpen(false); const newPath = pathname.replace(localActive, nextLocale); startTransition(() => { - router.replace(newPath); + // router.replace(newPath); + router.push(newPath); }); };