From 83e17861bdce28b970636ed44d0ce63b112ff8cf Mon Sep 17 00:00:00 2001 From: or-else Date: Fri, 23 Mar 2018 19:36:59 -0700 Subject: [PATCH] allow the same file to be attached, bug in login --- index.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index b42e82b2..ee96a3e0 100644 --- a/index.html +++ b/index.html @@ -1135,6 +1135,8 @@ function(err) { this.props.onError(err, "err"); }); + // Clear the value so the same file can be uploaded again. + e.target.value = ''; }, render: function() { return ( @@ -3337,6 +3339,8 @@ }); } } + // Clear the value so the same file can be uploaded again. + e.target.value = ''; }, handleAttachFile: function(e) { @@ -3355,6 +3359,8 @@ }, false); reader.readAsDataURL(file); } + // Clear the value so the same file can be uploaded again. + e.target.value = ''; }, handleSend: function() { @@ -3605,11 +3611,11 @@ var promise = null; var token = Tinode.getLoginToken(); - if (token) { - promise = Tinode.loginToken(token.token, cred); - } else if (password) { + if (login && password) { this.setState({password: null}); promise = Tinode.loginBasic(login, password, cred); + } else if (token) { + promise = Tinode.loginToken(token.token, cred); } else { this.setState({loginDisabled: false}); }