use TransformStream if available
This commit is contained in:
parent
f32ebd913a
commit
38fd349d9b
3 changed files with 13 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
import Keychain from './keychain';
|
||||
import { downloadStream } from './api';
|
||||
import { transform } from './streams';
|
||||
import { transformStream } from './streams';
|
||||
import contentDisposition from 'content-disposition';
|
||||
|
||||
let noSave = false;
|
||||
|
@ -24,7 +24,7 @@ async function decryptStream(request) {
|
|||
|
||||
const body = await file.download.result;
|
||||
|
||||
const readStream = transform(body, {
|
||||
const readStream = transformStream(body, {
|
||||
transform: (chunk, controller) => {
|
||||
file.progress += chunk.length;
|
||||
controller.enqueue(chunk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue