mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-21 14:46:31 +08:00
fix(files): Not-yet-downloaded files can be opened via double click
Fixes T4840
This commit is contained in:
parent
b4eb8dc60c
commit
3a5f667a0b
2 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue