From 5d76ed888ce8d328913c15fde0b1026f0d60eb54 Mon Sep 17 00:00:00 2001 From: John Sullivan Date: Wed, 13 Oct 2021 13:19:34 -0700 Subject: [PATCH] Clean up global listener in Sidebar component. (#4331) Every time the component was mounted it would add another listener. Since old listeners would often error this could cause a lot of log spam, particularly when using the hotloader on a mobile device. --- client/components/Sidebar.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/components/Sidebar.vue b/client/components/Sidebar.vue index bb056215..6a7a23f7 100644 --- a/client/components/Sidebar.vue +++ b/client/components/Sidebar.vue @@ -195,6 +195,9 @@ export default { document.body.addEventListener("touchstart", this.onTouchStart, {passive: true}); }, + destroyed() { + document.body.removeEventListener("touchstart", this.onTouchStart, {passive: true}); + }, methods: { isPublic: () => document.body.classList.contains("public"), },