perf: disable router.refresh

This commit is contained in:
hamster1963 2024-09-26 12:37:13 +08:00
parent 9cedaf0c5a
commit 8d4b6b81b7
2 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,3 @@
import { useTranslations } from "next-intl";
import ServerList from "../../../components/ServerList";
import ServerOverview from "../../../components/ServerOverview";
import getEnv from "../../../lib/env-entry";

View File

@ -40,12 +40,11 @@ export function LanguageSwitcher() {
pathname === currentLocalePath ||
pathname === `${currentLocalePath}/`
) {
router.replace(newLocalePath);
router.push(newLocalePath);
} else {
const newPath = constructLocalePath(pathname, newLocale);
router.replace(newPath);
router.push(newPath);
}
router.refresh();
};
return (