From 3a1f6f15c61a8816c75c8f29cba5300c00733016 Mon Sep 17 00:00:00 2001 From: Pierre Schweiger Date: Sat, 28 Dec 2024 19:14:51 +0700 Subject: [PATCH] Prevent error on long press on the chatbox --- frontend/views/containers/chatroom/MessageBase.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/views/containers/chatroom/MessageBase.vue b/frontend/views/containers/chatroom/MessageBase.vue index 8eebf4f3a..1bf4583bc 100644 --- a/frontend/views/containers/chatroom/MessageBase.vue +++ b/frontend/views/containers/chatroom/MessageBase.vue @@ -221,7 +221,9 @@ export default ({ this.$emit('add-emoticon', emoticon.native || emoticon) }, openMenu () { - this.$refs.messageAction.$refs.menu.handleTrigger() + if (this.$refs.messageAction?.$refs?.menu) { + this.$refs.messageAction.$refs.menu.handleTrigger() + } }, longPressHandler (e) { const wrappingLinkTag = e.target.closest('a.link[href]') @@ -230,7 +232,7 @@ export default ({ const url = wrappingLinkTag.getAttribute('href') sbp('okTurtles.events/emit', OPEN_TOUCH_LINK_HELPER, url) e?.preventDefault() - } else { + } else if (!this.isEditing) { this.openMenu() } }