diff --git a/frontend/app/services/conversion-service.js b/frontend/app/services/conversion-service.js index 712ccef2f0..9aad306e64 100644 --- a/frontend/app/services/conversion-service.js +++ b/frontend/app/services/conversion-service.js @@ -48,7 +48,7 @@ module.exports = function() { if (bytes > 1000000) { return ConversionService.megabytes(bytes) + 'MB'; } - return bytes + 'B' + return bytes + 'B'; } }; diff --git a/frontend/app/work_packages/directives/work-package-attachments-directive.js b/frontend/app/work_packages/directives/work-package-attachments-directive.js index a18c3eaa16..d1a21ae3d4 100644 --- a/frontend/app/work_packages/directives/work-package-attachments-directive.js +++ b/frontend/app/work_packages/directives/work-package-attachments-directive.js @@ -40,9 +40,12 @@ module.exports = function( var workPackage = scope.workPackage(), upload = function(event, workPackage) { - workPackageAttachmentsService.upload(workPackage, scope.files).then(function() { - scope.files = []; - }).finally(loadAttachments); + if (scope.files.length > 0) { + workPackageAttachmentsService.upload(workPackage, scope.files).then(function() { + scope.files = []; + loadAttachments() + }); + }; }, loadAttachments = function() { if (!editMode(attrs)) { diff --git a/frontend/app/work_packages/services/work-package-attachments-service.js b/frontend/app/work_packages/services/work-package-attachments-service.js index 2999eaf7a3..0339f39275 100644 --- a/frontend/app/work_packages/services/work-package-attachments-service.js +++ b/frontend/app/work_packages/services/work-package-attachments-service.js @@ -87,7 +87,7 @@ module.exports = function(Upload, PathHelper, I18n, NotificationsService, $q, $t removal.resolve(fileOrAttachment); } return removal.promise; - } + }; return { upload: upload,