Emojis update realtime

This commit is contained in:
10G Meow 2022-06-08 14:13:40 +00:00 committed by N Pex
parent 431e26f539
commit 6951340081
6 changed files with 14 additions and 13 deletions

View file

@ -15,24 +15,33 @@ export default {
return {}
}
},
reactions: {
timelineSet: {
type: Object,
default: function () {
return null
}
}
},
},
data() {
return {
reactionMap: {}
reactionMap: {},
reactions: null
}
},
mounted() {
this.reactions = this.timelineSet.getRelationsForEvent(this.event.getId(), 'm.annotation', 'm.reaction');
this.event.on("Event.relationsCreated", this.onRelationsCreated);
},
beforeDestroy() {
this.event.off("Event.relationsCreated", this.onRelationsCreated);
if (this.reactions) {
this.reactions.off('Relations.add', this.onAddRelation);
}
},
methods: {
onRelationsCreated() {
this.reactions = this.timelineSet.getRelationsForEvent(this.event.getId(), 'm.annotation', 'm.reaction');
},
onClickEmoji(emoji) {
this.$bubble('send-quick-reaction', {reaction:emoji, event:this.event});
},