Commit 7a981923 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: do not re-init active locale (#7329)

parent 9672c2db
...@@ -10,6 +10,7 @@ i18n.load(DEFAULT_LOCALE, DEFAULT_MESSAGES) ...@@ -10,6 +10,7 @@ i18n.load(DEFAULT_LOCALE, DEFAULT_MESSAGES)
i18n.activate(DEFAULT_LOCALE) i18n.activate(DEFAULT_LOCALE)
export async function dynamicActivate(locale: SupportedLocale) { export async function dynamicActivate(locale: SupportedLocale) {
if (i18n.locale === locale) return
try { try {
const catalog = await import(`locales/${locale}.js`) const catalog = await import(`locales/${locale}.js`)
// Bundlers will either export it as default or as a named export named default. // Bundlers will either export it as default or as a named export named default.
......
...@@ -78,8 +78,10 @@ const userSlice = createSlice({ ...@@ -78,8 +78,10 @@ const userSlice = createSlice({
state.selectedWallet = wallet state.selectedWallet = wallet
}, },
updateUserLocale(state, action) { updateUserLocale(state, action) {
state.userLocale = action.payload.userLocale if (action.payload.userLocale !== state.userLocale) {
state.timestamp = currentTimestamp() state.userLocale = action.payload.userLocale
state.timestamp = currentTimestamp()
}
}, },
updateUserSlippageTolerance(state, action) { updateUserSlippageTolerance(state, action) {
state.userSlippageTolerance = action.payload.userSlippageTolerance state.userSlippageTolerance = action.payload.userSlippageTolerance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment