diff --git a/internal_packages/attachments/lib/attachment-component.cjsx b/internal_packages/attachments/lib/attachment-component.cjsx index 185113be7..3b5f239b5 100644 --- a/internal_packages/attachments/lib/attachment-component.cjsx +++ b/internal_packages/attachments/lib/attachment-component.cjsx @@ -54,7 +54,7 @@ class AttachmentComponent extends React.Component _canAbortDownload: -> true - _canClickToView: => not @props.removable and not @_isDownloading() + _canClickToView: => not @props.removable _isDownloading: => @props.download?.state is "downloading" @@ -74,7 +74,8 @@ class AttachmentComponent extends React.Component event.preventDefault() return - _onClickView: => Actions.fetchAndOpenFile(@props.file) if @_canClickToView() + _onClickView: => + Actions.fetchAndOpenFile(@props.file) if @_canClickToView() _onClickRemove: (event) => Actions.removeFile diff --git a/src/flux/stores/file-download-store.coffee b/src/flux/stores/file-download-store.coffee index 201b4cc76..1057b9ea5 100644 --- a/src/flux/stores/file-download-store.coffee +++ b/src/flux/stores/file-download-store.coffee @@ -68,12 +68,12 @@ class Download # a callback until the stream has ended. These helper functions ensure # that resolve or reject is only fired once regardless of the order # these two events (stream end and `success`) happen in. - streamEnded = -> + streamEnded = => finished = true if finishedAction finishedAction(@) - onStreamEnded = (action) -> + onStreamEnded = (action) => if finished action(@) else