Fix tests

pull/4562/head
Chocobozzz 2021-11-24 09:19:02 +01:00
parent 842a15732b
commit 17e2705f64
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -10,8 +10,8 @@ let webtorrent: WebTorrent.Instance
function webtorrentAdd (torrentId: string, refreshWebTorrent = false) {
const WebTorrent = require('webtorrent')
if (!webtorrent) webtorrent = new WebTorrent()
if (refreshWebTorrent === true) webtorrent = new WebTorrent()
if (webtorrent && refreshWebTorrent) webtorrent.destroy()
if (!webtorrent || refreshWebTorrent) webtorrent = new WebTorrent()
webtorrent.on('error', err => console.error('Error in webtorrent', err))