From 347b05bad7da0615fc887aff445d60cb05bba176 Mon Sep 17 00:00:00 2001 From: Quentin Decaunes Date: Thu, 19 Mar 2020 16:13:48 +0100 Subject: [PATCH] fix: Unable to change language while loading system signature in some case. --- src/App.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 70ccf58..608ed14 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -84,16 +84,17 @@ class App extends React.Component<{}, AppState> { .then((data: SysInfoState) => { data.signature = createMachineSignature(data); data.permissiveSignature = createPermissiveMachineSignature(data); - this._isMounted && this.setState({ sysinfo: data }); + if (this._isMounted) this.setState({ sysinfo: data }); }) .catch((error: string) => { - this._isMounted && + if (this._isMounted) { this.setState({ sysinfo: { ...this.state.sysinfo, error: error, }, }); + } }); checkNewVersion();