fix: do not re-init active locale (#7329)
This commit is contained in:
parent
9672c2db9a
commit
7a981923f6
@ -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({
|
|||||||
state.selectedWallet = wallet
|
state.selectedWallet = wallet
|
||||||
},
|
},
|
||||||
updateUserLocale(state, action) {
|
updateUserLocale(state, action) {
|
||||||
|
if (action.payload.userLocale !== state.userLocale) {
|
||||||
state.userLocale = action.payload.userLocale
|
state.userLocale = action.payload.userLocale
|
||||||
state.timestamp = currentTimestamp()
|
state.timestamp = currentTimestamp()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
updateUserSlippageTolerance(state, action) {
|
updateUserSlippageTolerance(state, action) {
|
||||||
state.userSlippageTolerance = action.payload.userSlippageTolerance
|
state.userSlippageTolerance = action.payload.userSlippageTolerance
|
||||||
|
Loading…
Reference in New Issue
Block a user