Skip to content

Commit

Permalink
SettingsState: put lang change into runInAction() (#380)
Browse files Browse the repository at this point in the history
This prevents a warning from MobX since state cannot be modified out of an action.
Not sure why this happens since setLanguage is already set as action: I guess it has
something to do with the fact that it's an async function.
  • Loading branch information
warpdesign authored Feb 10, 2023
1 parent 15c8b65 commit b28aec8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/state/settingsState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class SettingsState {
// finally set requested language
i18next.changeLanguage(lang)

this.lang = i18next.language
runInAction(() => (this.lang = i18next.language))
}

setDefaultTerminal(cmd: string): void {
Expand Down

0 comments on commit b28aec8

Please sign in to comment.