Fix sending messages with no attachments

This commit is contained in:
lilia 2015-05-21 19:01:37 -07:00
parent a5e80e8a5a
commit d0a529351c

View file

@ -139,13 +139,13 @@
}, },
hasFiles: function() { hasFiles: function() {
var files = [this.file] || this.$input.prop('files'); var files = this.file ? [this.file] : this.$input.prop('files');
return files && files.length && files.length > 0; return files && files.length && files.length > 0;
}, },
getFiles: function() { getFiles: function() {
var promises = []; var promises = [];
var files = [this.file] || this.$input.prop('files'); var files = this.file ? [this.file] : this.$input.prop('files');
for (var i = 0; i < files.length; i++) { for (var i = 0; i < files.length; i++) {
promises.push(this.getFile(files[i])); promises.push(this.getFile(files[i]));
} }