Skip to content

Commit

Permalink
Merge branch 'release-v1.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Jan 19, 2024
2 parents eb7d3c6 + c437389 commit 7284c3e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/client/src/i18n/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,19 @@ export const intlReducer: LoopReducer<IntlState, any> = (
switch (action.type) {
case actions.CHANGE_LANGUAGE:
const messages = getNextMessages(action.payload.language, state.languages)
let language = action.payload.language

if (!state.languages[language]) {
language = getDefaultLanguage()
}

return loop(
{
...state,
language: action.payload.language,
language,
messages
},
Cmd.run(() => storeLanguage(action.payload.language))
Cmd.run(() => storeLanguage(language))
)

case offlineActions.READY:
Expand Down
9 changes: 7 additions & 2 deletions packages/login/src/i18n/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,19 @@ export const intlReducer: LoopReducer<IntlState, any> = (
}
case actions.CHANGE_LANGUAGE:
const messages = getNextMessages(action.payload.language, state.languages)
let language = action.payload.language

if (!state.languages[language]) {
language = getDefaultLanguage()
}

return loop(
{
...state,
language: action.payload.language,
language,
messages
},
Cmd.run(() => storeLanguage(action.payload.language))
Cmd.run(() => storeLanguage(language))
)
default:
return state
Expand Down

0 comments on commit 7284c3e

Please sign in to comment.