Fix memory leak

This commit is contained in:
dragongoose 2023-08-18 13:28:43 -04:00
parent fc498f078d
commit 0b49686eda
No known key found for this signature in database
GPG Key ID: 01397EEC371CDAA5

View File

@ -28,11 +28,13 @@ export default {
this.data = data this.data = data
}) })
this.getMoreStreams() window.onscroll = this.getMoreStreams
},
beforeUnmount() {
window.onscroll = null
}, },
methods: { methods: {
getMoreStreams() { async getMoreStreams() {
window.onscroll = async () => {
let bottomOfWindow = let bottomOfWindow =
document.documentElement.scrollTop + window.innerHeight === document.documentElement.scrollTop + window.innerHeight ===
document.documentElement.offsetHeight document.documentElement.offsetHeight
@ -61,7 +63,6 @@ export default {
} }
} }
} }
}
}, },
abbreviate abbreviate
}, },