Skip to content

Commit

Permalink
Prevent error on long press on the chatbox (#2484)
Browse files Browse the repository at this point in the history
  • Loading branch information
pieer authored Jan 12, 2025
1 parent 1f05932 commit 494c3f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/views/containers/chatroom/MessageBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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]')
Expand All @@ -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()
}
}
Expand Down

0 comments on commit 494c3f8

Please sign in to comment.