sindresorhus/electron-dl

BUG: Promise is not working correctly

开放

#67 创建于 2018年7月5日

 (3 条评论) (3 个反应) (0 位负责人)JavaScript (136 个派生)user submission
bughelp wanted

仓库指标

星标
 (1,206 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

#66

download This library works correctly for same syntax

Promise
.all(['https://download.filezilla-project.org/client/FileZilla_3.34.0_win64-setup_bundled.exe', 'http://the.earth.li/~sgtatham/putty/latest/w32/putty-0.70-installer.msi', 'http://speedtest.ftp.otenet.gr/files/test10Mb.db']
.map(function (x) {
    return download(x, 'dist');
})).then(function () {
    console.log('files downloaded!');
});

electron-dl: while using same with electron-dl does not. Promise returns before downloads


  Promise
.all(['https://download.filezilla-project.org/client/FileZilla_3.34.0_win64-setup_bundled.exe', 'http://the.earth.li/~sgtatham/putty/latest/w32/putty-0.70-installer.msi', 'http://speedtest.ftp.otenet.gr/files/test10Mb.db']
.map(function (x) {
    return download(BrowserWindow.getFocusedWindow(), x);
  })).then(function (x) {
    console.log('files downloaded!');
  });

贡献者指南