diff --git a/src/views/Host.vue b/src/views/Host.vue index 2c0519c..58e203a 100644 --- a/src/views/Host.vue +++ b/src/views/Host.vue @@ -117,14 +117,16 @@ export default { torrent.on('upload', bytes => { state.uploaded += bytes - updateWireStatistics() }) torrent.on('wire', wire => { - updateWireStatistics() toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 }) }) + setInterval(() => { + updateWireStatistics() + }, 200) + toast.add({ severity: 'success', summary: 'Video added', detail: `You are now sharing ${video.name}`, life: 5000 }) }) } diff --git a/src/views/Screen.vue b/src/views/Screen.vue index 0e5029c..1e5f71b 100644 --- a/src/views/Screen.vue +++ b/src/views/Screen.vue @@ -105,7 +105,6 @@ export default { const downloadVideo = (infoHash) => { webTorrent.add(infoHash, { announce: trackers }, torrent => { torrent.on('wire', () => { - updateWireStatistics() toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 }) }) @@ -114,7 +113,6 @@ export default { }) torrent.on('upload', bytes => { - updateWireStatistics() }) torrent.on('download', bytes => { @@ -124,7 +122,6 @@ export default { } state.downloaded += bytes progress.value = state.downloaded / video.size * 100 - updateWireStatistics() }) }) } @@ -148,6 +145,10 @@ export default { }) file.renderTo(player.value) + + setInterval(() => { + updateWireStatistics() + }, 200) } const updateWireStatistics = () => {