diff --git a/src/components/Channel.vue b/src/components/Channel.vue
index 25123781..780b7558 100644
--- a/src/components/Channel.vue
+++ b/src/components/Channel.vue
@@ -2,7 +2,9 @@
@@ -52,6 +54,9 @@ export default { deactivated() { window.removeEventListener("scroll", this.handleScroll); }, + unmounted() { + window.removeEventListener("scroll", this.handleScroll); + }, methods: { async fetchSubscribedStatus() { this.fetchJson( diff --git a/src/components/Player.vue b/src/components/Player.vue index cfd5e020..4dba6063 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -280,6 +280,19 @@ export default { videoEl.volume = this.getPreferenceNumber("volume", 1); }); }, + destroy() { + if (this.ui) { + this.ui.destroy(); + this.ui = undefined; + this.player = undefined; + } + if (this.player) { + this.player.destroy(); + this.player = undefined; + } + if (this.hotkeys) this.hotkeys.unbind(); + if (this.$refs.container) this.$refs.container.querySelectorAll("div").forEach(node => node.remove()); + }, }, activated() { import("hotkeys-js") @@ -334,17 +347,10 @@ export default { }); }, deactivated() { - if (this.ui) { - this.ui.destroy(); - this.ui = undefined; - this.player = undefined; - } - if (this.player) { - this.player.destroy(); - this.player = undefined; - } - if (this.hotkeys) this.hotkeys.unbind(); - if (this.$refs.container) this.$refs.container.querySelectorAll("div").forEach(node => node.remove()); + this.destroy(); + }, + unmounted() { + this.destroy(); }, }; diff --git a/src/components/SearchResults.vue b/src/components/SearchResults.vue index 43309357..9e910eae 100644 --- a/src/components/SearchResults.vue +++ b/src/components/SearchResults.vue @@ -49,7 +49,9 @@ {{ result.uploaderName }} -