Skip to content

Commit 2c4944f

Browse files
committed
(fix) close options triggered twice on mobile
1 parent a45dd18 commit 2c4944f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ChatWindow/Message.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ export default {
244244
imageHover: false,
245245
messageHover: false,
246246
optionsOpened: false,
247+
optionsClosing: false,
247248
menuOptionsTop: 0,
248249
messageReaction: '',
249250
newMessage: {},
@@ -398,8 +399,9 @@ export default {
398399
image.addEventListener('load', () => (this.imageLoading = false))
399400
},
400401
openOptions() {
401-
this.optionsOpened = !this.optionsOpened
402+
if (this.optionsClosing) return
402403
404+
this.optionsOpened = !this.optionsOpened
403405
if (!this.optionsOpened) return
404406
405407
this.$emit('hideOptions', false)
@@ -427,6 +429,9 @@ export default {
427429
},
428430
closeOptions() {
429431
this.optionsOpened = false
432+
this.optionsClosing = true
433+
setTimeout(() => (this.optionsClosing = false), 100)
434+
430435
if (this.hoverMessageId !== this.message._id) this.messageHover = false
431436
},
432437
openEmoji() {

0 commit comments

Comments
 (0)