Add progress bar for pad download

This commit is contained in:
ClemDee
2019-08-14 15:42:32 +02:00
parent 2ee3b77a43
commit f017215300
3 changed files with 16 additions and 5 deletions

View File

@@ -92,7 +92,15 @@ define([
var opts = {
password: pData.password
};
updateProgress.progress(0);
var done = false;
ctx.sframeChan.on("EV_CRYPTGET_PROGRESS", function (data) {
if (done || data.hash !== parsed.hash) { return; }
updateProgress.progress(data.progress);
if (data.progress === 1) {
done = true;
updateProgress.progress2(1);
}
});
ctx.get({
hash: parsed.hash,
opts: opts
@@ -100,12 +108,9 @@ define([
if (cancelled) { return; }
if (err) { return; }
if (!val) { return; }
updateProgress.progress(1);
transform(ctx, parsed.type, val, function (res) {
if (cancelled) { return; }
if (!res.data) { return; }
updateProgress.progress2(1);
var dl = function () {
saveAs(res.data, Util.fixFileName(name));
};