mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
perf: disable router.refresh
This commit is contained in:
parent
9cedaf0c5a
commit
8d4b6b81b7
@ -1,4 +1,3 @@
|
|||||||
import { useTranslations } from "next-intl";
|
|
||||||
import ServerList from "../../../components/ServerList";
|
import ServerList from "../../../components/ServerList";
|
||||||
import ServerOverview from "../../../components/ServerOverview";
|
import ServerOverview from "../../../components/ServerOverview";
|
||||||
import getEnv from "../../../lib/env-entry";
|
import getEnv from "../../../lib/env-entry";
|
||||||
@ -8,8 +7,8 @@ const disablePrefetch = getEnv("ServerDisablePrefetch") === "true";
|
|||||||
const fallback = disablePrefetch
|
const fallback = disablePrefetch
|
||||||
? {}
|
? {}
|
||||||
: {
|
: {
|
||||||
"/api/server": GetNezhaData(),
|
"/api/server": GetNezhaData(),
|
||||||
};
|
};
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<SWRConfig
|
<SWRConfig
|
||||||
|
@ -40,12 +40,11 @@ export function LanguageSwitcher() {
|
|||||||
pathname === currentLocalePath ||
|
pathname === currentLocalePath ||
|
||||||
pathname === `${currentLocalePath}/`
|
pathname === `${currentLocalePath}/`
|
||||||
) {
|
) {
|
||||||
router.replace(newLocalePath);
|
router.push(newLocalePath);
|
||||||
} else {
|
} else {
|
||||||
const newPath = constructLocalePath(pathname, newLocale);
|
const newPath = constructLocalePath(pathname, newLocale);
|
||||||
router.replace(newPath);
|
router.push(newPath);
|
||||||
}
|
}
|
||||||
router.refresh();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user