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)
i18n.activate(DEFAULT_LOCALE)
export async function dynamicActivate(locale: SupportedLocale) {
if (i18n.locale === locale) return
try {
const catalog = await import(`locales/${locale}.js`)
// Bundlers will either export it as default or as a named export named default.
......
......@@ -78,8 +78,10 @@ const userSlice = createSlice({
state.selectedWallet = wallet
},
updateUserLocale(state, action) {
state.userLocale = action.payload.userLocale
state.timestamp = currentTimestamp()
if (action.payload.userLocale !== state.userLocale) {
state.userLocale = action.payload.userLocale
state.timestamp = currentTimestamp()
}
},
updateUserSlippageTolerance(state, action) {
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