don't upload empty files

This commit is contained in:
Danny Coates 2017-08-29 11:20:34 -07:00
parent 74718d6361
commit 4b39d61ff4
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB

View File

@ -44,6 +44,9 @@ module.exports = function(state, emit) {
event.preventDefault(); event.preventDefault();
const target = event.target; const target = event.target;
const file = target.files[0]; const file = target.files[0];
if (file.size === 0) {
return;
}
await fadeOut('page-one'); await fadeOut('page-one');
emit('upload', { file, type: 'click' }); emit('upload', { file, type: 'click' });
} }