fixes downloading files as .part
This commit is contained in:
parent
9472d5eaa6
commit
5f79a9fb6d
1 changed files with 3 additions and 4 deletions
|
@ -63,7 +63,7 @@ export default class FileReceiver extends Nanobus {
|
||||||
state = await reader.read();
|
state = await reader.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.buffer;
|
return result.slice(0, offset).buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
async download(noSave = false) {
|
async download(noSave = false) {
|
||||||
|
@ -85,10 +85,9 @@ export default class FileReceiver extends Nanobus {
|
||||||
this.emit('decrypting');
|
this.emit('decrypting');
|
||||||
|
|
||||||
const dec = await this.keychain.decryptStream(ciphertext);
|
const dec = await this.keychain.decryptStream(ciphertext);
|
||||||
const plainstream = dec.stream;
|
|
||||||
const plaintext = await this.streamToArrayBuffer(
|
const plaintext = await this.streamToArrayBuffer(
|
||||||
plainstream,
|
dec.stream,
|
||||||
dec.streamInfo.fileSize
|
this.fileInfo.size
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!noSave) {
|
if (!noSave) {
|
||||||
|
|
Loading…
Reference in a new issue