do not logout of server errors 500 or timeouts

This commit is contained in:
or-else
2023-01-11 09:03:48 -08:00
parent c085ef8ce1
commit 15d24c6607
5 changed files with 17 additions and 11 deletions
+7 -4
View File
@@ -8357,19 +8357,22 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.handleLoginSuccessful();
}
}).catch(err => {
const autoLogin = err.code >= 500;
this.setState({
loginDisabled: false,
credMethod: undefined,
credCode: undefined,
loadSpinnerVisible: false,
autoLogin: false
autoLogin: autoLogin
});
this.handleError(err.message, 'err');
console.warn("Login failed", err);
if (token) {
this.handleLogout();
if (!autoLogin) {
if (token) {
this.handleLogout();
}
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo('');
}
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_18__["default"].navigateTo('');
});
}
static navigateToCredentialsView(params) {