fix: activation page reload issue after activating (#964)

This commit is contained in:
Matri
2023-08-23 13:54:40 +08:00
committed by GitHub
parent a38412de7b
commit 916d8be0ae
3 changed files with 13 additions and 12 deletions

View File

@@ -9,8 +9,8 @@ export const getLocaleOnClient = (): Locale => {
return Cookies.get(LOCALE_COOKIE_NAME) as Locale || i18n.defaultLocale
}
export const setLocaleOnClient = (locale: Locale) => {
export const setLocaleOnClient = (locale: Locale, reloadPage = true) => {
Cookies.set(LOCALE_COOKIE_NAME, locale)
changeLanguage(locale)
location.reload()
reloadPage && location.reload()
}