From 9283c4ede252b543c64432ffd87d0d66b9530384 Mon Sep 17 00:00:00 2001 From: or-else Date: Sat, 17 Mar 2018 18:57:10 -0700 Subject: [PATCH] minor corrections --- index.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index e4338657..5b01e029 100644 --- a/index.html +++ b/index.html @@ -1015,13 +1015,13 @@
@@ -1786,6 +1786,11 @@ }, this); updateFavicon(totalUnread > 0); + // Sort: most recent to less recent. + //contacts.sort(function(a, b) { + // return a.updated - b.updated; + //}); + return contacts; }, @@ -2211,8 +2216,11 @@ }, handleSubmit: function(e) { e.preventDefault(); - if (this.state.groupId && this.state.groupId.trim()) { - this.props.onSubmit(this.state.groupId.trim()); + if (this.state.groupId) { + var name = this.state.groupId.trim(); + if (name.length > 3 && (name.substr(0, 3) == 'usr' || name.substr(0, 3) == 'grp')) { + this.props.onSubmit(name); + } } }, render: function() { @@ -3591,18 +3599,12 @@ }, doLogin: function(login, password, cred) { - console.log("doLogin", login, password, cred); - var instance = this; cred = cred ? Tinode.addCredential(null, cred.type, null, null, cred.resp).cred : undefined; - - console.log("doLogin cred=", cred); // Try to login with token. If token is not available, try password. If no password, ask for it. var promise = null; var token = Tinode.getLoginToken(); - console.log("doLogin token=", token); - if (token) { promise = Tinode.loginToken(token.token, cred); } else if (password) {