Clear wire statistics update interval on unmount
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
734e791045
commit
8561b9c6c6
|
@ -59,6 +59,7 @@ export default {
|
|||
const toast = useToast()
|
||||
const trackers = inject('trackers')
|
||||
var webTorrent = null
|
||||
var wireUpdateHandle = null
|
||||
const player = ref(null)
|
||||
const video = reactive({
|
||||
file: null,
|
||||
|
@ -85,6 +86,9 @@ export default {
|
|||
if (webTorrent) {
|
||||
webTorrent.destroy()
|
||||
}
|
||||
if (wireUpdateHandle) {
|
||||
clearInterval(wireUpdateHandle)
|
||||
}
|
||||
})
|
||||
|
||||
const onFilesSelected = (f) => {
|
||||
|
@ -123,7 +127,7 @@ export default {
|
|||
toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 })
|
||||
})
|
||||
|
||||
setInterval(() => {
|
||||
wireUpdateHandle = setInterval(() => {
|
||||
updateWireStatistics()
|
||||
}, 200)
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ export default {
|
|||
const toast = useToast()
|
||||
const trackers = inject('trackers')
|
||||
var webTorrent = null
|
||||
var wireUpdateHandle = null
|
||||
const player = ref(null)
|
||||
const progress = ref()
|
||||
const video = reactive({
|
||||
|
@ -100,6 +101,9 @@ export default {
|
|||
if (webTorrent) {
|
||||
webTorrent.destroy()
|
||||
}
|
||||
if (wireUpdateHandle) {
|
||||
clearInterval(wireUpdateHandle)
|
||||
}
|
||||
})
|
||||
|
||||
const downloadVideo = (infoHash) => {
|
||||
|
@ -146,7 +150,7 @@ export default {
|
|||
|
||||
file.renderTo(player.value)
|
||||
|
||||
setInterval(() => {
|
||||
wireUpdateHandle = setInterval(() => {
|
||||
updateWireStatistics()
|
||||
}, 200)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue