From 5f79a9fb6de4caf0e9866881aa254066c5c6103b Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 28 Jun 2018 11:15:16 -0700 Subject: [PATCH] fixes downloading files as .part --- app/fileReceiver.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/fileReceiver.js b/app/fileReceiver.js index 2a22fbca..aef142b0 100644 --- a/app/fileReceiver.js +++ b/app/fileReceiver.js @@ -63,7 +63,7 @@ export default class FileReceiver extends Nanobus { state = await reader.read(); } - return result.buffer; + return result.slice(0, offset).buffer; } async download(noSave = false) { @@ -85,10 +85,9 @@ export default class FileReceiver extends Nanobus { this.emit('decrypting'); const dec = await this.keychain.decryptStream(ciphertext); - const plainstream = dec.stream; const plaintext = await this.streamToArrayBuffer( - plainstream, - dec.streamInfo.fileSize + dec.stream, + this.fileInfo.size ); if (!noSave) {