Optimize when destroyed
This commit is contained in:
parent
10c94c4c24
commit
9ebf319211
@ -22,7 +22,7 @@ export default {
|
|||||||
const protocol = import.meta.env.VITE_HTTPS === 'true' ? 'https://' : 'http://'
|
const protocol = import.meta.env.VITE_HTTPS === 'true' ? 'https://' : 'http://'
|
||||||
|
|
||||||
const badgesFetch = await fetch(`${protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/badges?channelName=${props.channelName}`)
|
const badgesFetch = await fetch(`${protocol}${import.meta.env.VITE_BACKEND_DOMAIN}/api/badges?channelName=${props.channelName}`)
|
||||||
let badges: Badge[] = await badgesFetch.json()
|
let badges: Badge[] = (await badgesFetch.json()).data
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ws: new WebSocket(`ws://${import.meta.env.VITE_BACKEND_DOMAIN}`),
|
ws: new WebSocket(`ws://${import.meta.env.VITE_BACKEND_DOMAIN}`),
|
||||||
@ -75,6 +75,10 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
BadgeVue
|
BadgeVue
|
||||||
|
},
|
||||||
|
unmounted() {
|
||||||
|
this.messages = []
|
||||||
|
this.badges = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -34,6 +34,9 @@ export default {
|
|||||||
this.player = videojs('video-player', this.options, () => {
|
this.player = videojs('video-player', this.options, () => {
|
||||||
createQualitySelector(this.player)
|
createQualitySelector(this.player)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
unmounted() {
|
||||||
|
this.player.dispose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user