From b176d6fee1cbcf560ce555a079e0f55cbc300f87 Mon Sep 17 00:00:00 2001 From: "MSI\\User" Date: Tue, 20 Aug 2024 16:31:10 +0800 Subject: [PATCH] wait 0.08s to reload after changing language --- src/components/AppBar/Profile.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/AppBar/Profile.tsx b/src/components/AppBar/Profile.tsx index c045107..c14d318 100644 --- a/src/components/AppBar/Profile.tsx +++ b/src/components/AppBar/Profile.tsx @@ -35,7 +35,9 @@ const Profile: React.FC = ({ avatarImageSrc, profileName }) => { const params = new URLSearchParams(searchParams.toString()) params.set("lang", lang) router.replace(`${pathname}?${params.toString()}`); - window.location.reload(); + setTimeout(() => { + window.location.reload(); + }, 80); }, [router, pathname, searchParams]); return (