-
+
{{ name }} {{ value.length }}
@@ -48,6 +48,12 @@ export default {
onAddRelation(ignoredevent) {
this.processReactions();
},
+ onRemoveRelation(ignoredevent) {
+ this.processReactions();
+ },
+ onRedactRelation(ignoredevent) {
+ this.processReactions();
+ },
processReactions() {
var reactionMap = {};
if (this.reactions && this.reactions._eventsCount > 0) {
@@ -57,10 +63,13 @@ export default {
const sender = r.getSender();
if (reactionMap[emoji]) {
const array = reactionMap[emoji];
+ if (r.isRedacted()) {
+ delete array[sender];
+ }
if (!array.includes(sender)) {
array.push(sender)
}
- } else {
+ } else if (!r.isRedacted()) {
reactionMap[emoji] = [sender];
}
}
@@ -73,9 +82,13 @@ export default {
handler(newValue, oldValue) {
if (oldValue) {
oldValue.off('Relations.add', this.onAddRelation);
+ oldValue.off('Relations.remove', this.onRemoveRelation);
+ oldValue.off('Relations.redaction', this.onRedactRelation);
}
if (newValue) {
newValue.on('Relations.add', this.onAddRelation);
+ newValue.on('Relations.remove', this.onRemoveRelation);
+ newValue.on('Relations.redaction', this.onRedactRelation);
}
this.processReactions();
},
diff --git a/src/main.js b/src/main.js
index 82db06b..ac459b3 100644
--- a/src/main.js
+++ b/src/main.js
@@ -36,10 +36,18 @@ Vue.use((Vue) => {
Vue.prototype.$bubble = function $bubble(eventName, ...args) {
// Emit the event on all parent components
let component = this;
+ let arg = args.at(0);
+ let stop = false;
+ if (arg) {
+ // Add a "stopPropagation" function so that we can do v-on:.stop="..."
+ arg.stopPropagation = () => {
+ stop = true;
+ }
+ }
do {
- component.$emit(eventName, ...args);
+ component.$emit(eventName, ... args);
component = component.$parent;
- } while (component);
+ } while (!stop && component);
};
});