From 904754b20df287167001834e531a02ca473bf678 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 21 Jul 2015 20:55:23 -0700 Subject: [PATCH] Allow uploading the same file twice --- skins/base/views/molecules/MessageComposer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skins/base/views/molecules/MessageComposer.js b/skins/base/views/molecules/MessageComposer.js index 1fc64862..639c5bff 100644 --- a/skins/base/views/molecules/MessageComposer.js +++ b/skins/base/views/molecules/MessageComposer.js @@ -33,7 +33,10 @@ module.exports = React.createClass({ onUploadFileSelected: function(ev) { var files = ev.target.files; // MessageComposer shouldn't have to rely on it's parent passing in a callback to upload a file - this.props.uploadFile(files[0]); + if (files && files.length > 0) { + this.props.uploadFile(files[0]); + } + this.refs.uploadInput.getDOMNode().value = null; }, render: function() {