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
commit 916d8be0ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()
}