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