Skip to content

Commit b28aec8

Browse files
authored
SettingsState: put lang change into runInAction() (#380)
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.
1 parent 15c8b65 commit b28aec8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/state/settingsState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class SettingsState {
9595
// finally set requested language
9696
i18next.changeLanguage(lang)
9797

98-
this.lang = i18next.language
98+
runInAction(() => (this.lang = i18next.language))
9999
}
100100

101101
setDefaultTerminal(cmd: string): void {

0 commit comments

Comments
 (0)