diff --git a/client/components/Mentions.vue b/client/components/Mentions.vue index dddb0d42..9f75982f 100644 --- a/client/components/Mentions.vue +++ b/client/components/Mentions.vue @@ -185,10 +185,12 @@ export default { }, }, mounted() { - eventbus.on("mentions:toggle", this.openPopup); + eventbus.on("mentions:toggle", this.togglePopup); + eventbus.on("escapekey", this.closePopup); }, destroyed() { - eventbus.off("mentions:toggle", this.openPopup); + eventbus.off("mentions:toggle", this.togglePopup); + eventbus.off("escapekey", this.closePopup); }, methods: { messageTime(time) { @@ -211,7 +213,7 @@ export default { this.isOpen = false; } }, - openPopup() { + togglePopup() { this.isOpen = !this.isOpen; if (this.isOpen) { @@ -219,6 +221,9 @@ export default { socket.emit("mentions:get"); } }, + closePopup() { + this.isOpen = false; + }, }, };