Merge pull request #1679 from webtorrent/then

Use promise then() instead of catch() with callbacks
This commit is contained in:
Feross Aboukhadijeh
2019-09-10 11:05:12 -07:00
committed by GitHub
2 changed files with 13 additions and 7 deletions

View File

@@ -151,8 +151,10 @@ function setupStateSaved (cb) {
})
Promise.all(tasks)
.then(() => cb(null, saved))
.catch(err => cb(err))
.then(
() => cb(null, saved),
err => cb(err)
)
function createTorrentObject (t) {
// TODO: Doing several fs.readFileSync calls during first startup is not ideal