diff --git a/app/modules/components/attachment/attachment.controller.coffee b/app/modules/components/attachment/attachment.controller.coffee index fa489e46..487f107e 100644 --- a/app/modules/components/attachment/attachment.controller.coffee +++ b/app/modules/components/attachment/attachment.controller.coffee @@ -43,6 +43,8 @@ class AttachmentController save: () -> attachment = @.attachment.set('loading', true) + @.onUpdate({attachment: attachment}) + attachment = @.attachment.merge({ editable: false, loading: false diff --git a/app/modules/components/attachments-full/attachments-full.service.coffee b/app/modules/components/attachments-full/attachments-full.service.coffee index 625b8672..8f9a83a3 100644 --- a/app/modules/components/attachments-full/attachments-full.service.coffee +++ b/app/modules/components/attachments-full/attachments-full.service.coffee @@ -123,9 +123,14 @@ class AttachmentsFullService extends taiga.Service patch = taiga.patch(oldAttachment.get('file'), toUpdateAttachment.get('file')) - return @attachmentsService.patch(toUpdateAttachment.getIn(['file', 'id']), type, patch).then () => + if toUpdateAttachment.get('loading') @._attachments = @._attachments.set(index, toUpdateAttachment) @.regenerate() + else + return @attachmentsService.patch(toUpdateAttachment.getIn(['file', 'id']), type, patch).then () => + @._attachments = @._attachments.set(index, toUpdateAttachment) + + @.regenerate() angular.module("taigaComponents").service("tgAttachmentsFullService", AttachmentsFullService)