critical bug: login stalls after refresh
This commit is contained in:
@@ -353,7 +353,8 @@ class TinodeWeb extends React.Component {
|
||||
loginDisabled: true,
|
||||
login: login,
|
||||
password: password,
|
||||
loadSpinnerVisible: true
|
||||
loadSpinnerVisible: true,
|
||||
autoLogin: true
|
||||
});
|
||||
this.handleError('', null);
|
||||
|
||||
@@ -362,7 +363,7 @@ class TinodeWeb extends React.Component {
|
||||
} else {
|
||||
this.tinode.connect().catch((err) => {
|
||||
// Socket error
|
||||
this.setState({loginDisabled: false});
|
||||
this.setState({loginDisabled: false, autoLogin: false});
|
||||
this.handleError(err.message, 'err');
|
||||
});
|
||||
}
|
||||
@@ -443,7 +444,7 @@ class TinodeWeb extends React.Component {
|
||||
cred = Tinode.credential(cred);
|
||||
// Try to login with login/password. If they are not available, try token. If no token, ask for login/password.
|
||||
let promise = null;
|
||||
let token = this.tinode.getAuthToken();
|
||||
const token = this.tinode.getAuthToken();
|
||||
if (login && password) {
|
||||
this.setState({password: null});
|
||||
promise = this.tinode.loginBasic(login, password, cred);
|
||||
@@ -468,7 +469,8 @@ class TinodeWeb extends React.Component {
|
||||
loginDisabled: false,
|
||||
credMethod: undefined,
|
||||
credCode: undefined,
|
||||
loadSpinnerVisible: false
|
||||
loadSpinnerVisible: false,
|
||||
autoLogin: false
|
||||
});
|
||||
this.handleError(err.message, 'err');
|
||||
localStorage.removeItem('auth-token');
|
||||
@@ -593,7 +595,7 @@ class TinodeWeb extends React.Component {
|
||||
// Merge search results and contact list to create a single flat
|
||||
// list of kown contacts for GroupManager to use.
|
||||
static prepareSearchableContacts(chatList, foundContacts) {
|
||||
let merged = {};
|
||||
const merged = {};
|
||||
|
||||
// For chatList topics merge only p2p topics and convert them to the
|
||||
// same format as foundContacts.
|
||||
|
||||
+6
-3
@@ -4965,7 +4965,8 @@ var TinodeWeb = function (_React$Component) {
|
||||
loginDisabled: true,
|
||||
login: login,
|
||||
password: password,
|
||||
loadSpinnerVisible: true
|
||||
loadSpinnerVisible: true,
|
||||
autoLogin: true
|
||||
});
|
||||
this.handleError('', null);
|
||||
|
||||
@@ -4977,7 +4978,8 @@ var TinodeWeb = function (_React$Component) {
|
||||
} else {
|
||||
this.tinode.connect().catch(function (err) {
|
||||
_this4.setState({
|
||||
loginDisabled: false
|
||||
loginDisabled: false,
|
||||
autoLogin: false
|
||||
});
|
||||
|
||||
_this4.handleError(err.message, 'err');
|
||||
@@ -5094,7 +5096,8 @@ var TinodeWeb = function (_React$Component) {
|
||||
loginDisabled: false,
|
||||
credMethod: undefined,
|
||||
credCode: undefined,
|
||||
loadSpinnerVisible: false
|
||||
loadSpinnerVisible: false,
|
||||
autoLogin: false
|
||||
});
|
||||
|
||||
_this6.handleError(err.message, 'err');
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user