mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 15:15:12 +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
|
_canAbortDownload: -> true
|
||||||
|
|
||||||
_canClickToView: => not @props.removable and not @_isDownloading()
|
_canClickToView: => not @props.removable
|
||||||
|
|
||||||
_isDownloading: => @props.download?.state is "downloading"
|
_isDownloading: => @props.download?.state is "downloading"
|
||||||
|
|
||||||
|
@ -74,7 +74,8 @@ class AttachmentComponent extends React.Component
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
return
|
return
|
||||||
|
|
||||||
_onClickView: => Actions.fetchAndOpenFile(@props.file) if @_canClickToView()
|
_onClickView: =>
|
||||||
|
Actions.fetchAndOpenFile(@props.file) if @_canClickToView()
|
||||||
|
|
||||||
_onClickRemove: (event) =>
|
_onClickRemove: (event) =>
|
||||||
Actions.removeFile
|
Actions.removeFile
|
||||||
|
|
|
@ -68,12 +68,12 @@ class Download
|
||||||
# a callback until the stream has ended. These helper functions ensure
|
# a callback until the stream has ended. These helper functions ensure
|
||||||
# that resolve or reject is only fired once regardless of the order
|
# that resolve or reject is only fired once regardless of the order
|
||||||
# these two events (stream end and `success`) happen in.
|
# these two events (stream end and `success`) happen in.
|
||||||
streamEnded = ->
|
streamEnded = =>
|
||||||
finished = true
|
finished = true
|
||||||
if finishedAction
|
if finishedAction
|
||||||
finishedAction(@)
|
finishedAction(@)
|
||||||
|
|
||||||
onStreamEnded = (action) ->
|
onStreamEnded = (action) =>
|
||||||
if finished
|
if finished
|
||||||
action(@)
|
action(@)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue