Merge pull request #6252 from nextcloud/only_show1_error

Don't try the actual file upload if the checks already error out
This commit is contained in:
Morris Jobke 2017-08-26 12:46:01 +02:00 committed by GitHub
commit cfe5d35862
3 changed files with 6 additions and 0 deletions

View File

@ -1113,6 +1113,9 @@ OC.Uploader.prototype = _.extend({
});
fileupload.on('fileuploaddrop', function(e, data) {
self.trigger('drop', e, data);
if (e.isPropagationStopped()) {
return false;
}
});
}

View File

@ -2795,6 +2795,7 @@
var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0;
if (!isCreatable) {
self._showPermissionDeniedNotification();
e.stopPropagation();
return false;
}

View File

@ -2810,6 +2810,8 @@ describe('OCA.Files.FileList tests', function() {
target: $target
},
preventDefault: function () {
},
stopPropagation: function() {
}
};
uploader.trigger('drop', eventData, data || {});