From fc2b9a91a438f0a0116db62ec6a046e7f5bc8438 Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Mon, 17 Feb 2020 13:05:24 +0100 Subject: [PATCH] Small but important fix computing file blocks. --- frontend/src/js/misc/wb-rootdir-wrapper.js | 2 +- frontend/src/js/page/wb-download-page.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/js/misc/wb-rootdir-wrapper.js b/frontend/src/js/misc/wb-rootdir-wrapper.js index ed8c4b2..6fc5fcd 100644 --- a/frontend/src/js/misc/wb-rootdir-wrapper.js +++ b/frontend/src/js/misc/wb-rootdir-wrapper.js @@ -69,7 +69,7 @@ class WBRootDirWrapper { for (let i = start; i < end; i++) { const loc = stm[i]; res.push([ loc[0], Math.max(0, seg[1] - loc[1]), - Math.min(loc[2], seg[1] + seg[2] - loc[1]) ]); + Math.min(loc[2] - loc[1], seg[1] + seg[2] - loc[1]) ]); } return res; }), file[1] ]; diff --git a/frontend/src/js/page/wb-download-page.js b/frontend/src/js/page/wb-download-page.js index 4b1e748..c41c4b6 100644 --- a/frontend/src/js/page/wb-download-page.js +++ b/frontend/src/js/page/wb-download-page.js @@ -95,7 +95,7 @@ class WBDownloadPage extends Component { const blk = xhr_1.response.slice(loc[1], loc[2]); // const r = new Response(blk); // r.body.pipeTo(fileStream); - writer.write(new Uint8Array(blk)); + return writer.write(new Uint8Array(blk)); }); } return prom_1;