fileDecrypter: fix download and encrypting state

This commit is contained in:
Peter Cai 2020-02-19 11:09:15 +08:00
parent b35c57f591
commit 182c225528
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
1 changed files with 2 additions and 2 deletions

View File

@ -49,10 +49,10 @@ class FileDecrypter extends React.Component
progress: e.loaded / e.total
xhr.addEventListener 'readystatechange', =>
if xhr.readyState == XMLHttpRequest.DONE
if xhr.status == 200
await @decryptFile xhr.response
@setState
downloading: false
return if xhr.status != 200 # We always fail silently here
@decryptFile xhr.response
xhr.open 'GET', @originalUrl
xhr.send()