Fix language selection (#726)

This commit is contained in:
BM 2020-02-07 10:43:30 +00:00 committed by GitHub
parent 3b20e6e2b8
commit a7dc067dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import { AppState } from "./types";
import { getDateTime } from "./utils";
import { getLanguage } from "./i18n";
const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`;
@ -28,6 +29,7 @@ export function getDefaultAppState(): AppState {
name: DEFAULT_PROJECT_NAME,
isResizing: false,
selectionElement: null,
lng: getLanguage(),
};
}

View File

@ -1820,7 +1820,7 @@ export class App extends React.Component<any, AppState> {
<LanguageList
onChange={lng => {
setLanguage(lng);
this.setState({});
this.setState({ lng });
}}
languages={languages}
currentLanguage={getLanguage()}

View File

@ -27,4 +27,5 @@ export type AppState = {
name: string;
selectedId?: string;
isResizing: boolean;
lng: string;
};