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.
This commit is contained in:
parent
2b634a6ba6
commit
5d76ed888c
@ -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"),
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user