From 84ad77a79517dc0df01b99c4976922182600c0ca Mon Sep 17 00:00:00 2001 From: root Date: Sun, 23 Jan 2022 11:15:10 +0530 Subject: [PATCH] Fix --- src/components/Player.vue | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index e4f7223..ed16fbe 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -278,6 +278,20 @@ export default { player.defaultPlaybackRate = rate } }) + }, + + destroy () { + if (this.$ui) { + this.$ui.destroy() + this.$ui = undefined + this.$player = undefined + } + if (this.$player) { + this.$player.destroy() + this.$player = undefined + } + if (this.unsubToKeybindings) this.unsubToKeybindings() + if (this.$refs.container) this.$refs.container.querySelectorAll('div').forEach(node => node.remove()) } }, @@ -341,17 +355,7 @@ export default { }, beforeDestroy () { - if (this.$ui) { - this.$ui.destroy() - this.$ui = undefined - this.$player = undefined - } - if (this.$player) { - this.$player.destroy() - this.$player = undefined - } - this.unsubToKeybindings() - this.$refs.container.querySelectorAll('div').forEach(node => node.remove()) + this.destroy() } }