Skip to content

Commit

Permalink
fix locale not remaining same in redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkmift committed May 19, 2024
1 parent 54644af commit 07450ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/Header/LocalSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
});
};

Expand Down

0 comments on commit 07450ea

Please sign in to comment.