on -> once

This commit is contained in:
Feross Aboukhadijeh
2016-06-01 00:10:26 -07:00
parent 8fc61a1c90
commit dac34541d6
4 changed files with 7 additions and 8 deletions

View File

@@ -270,7 +270,7 @@ function getTorrentProgress () {
function startServer (infoHash, index) {
var torrent = client.get(infoHash)
if (torrent.ready) startServerFromReadyTorrent(torrent, index)
else torrent.on('ready', () => startServerFromReadyTorrent(torrent, index))
else torrent.once('ready', () => startServerFromReadyTorrent(torrent, index))
}
function startServerFromReadyTorrent (torrent, index, cb) {