don't recreate the reactions after clearing it with the last one removed

This commit is contained in:
Bruno Windels 2021-06-03 21:00:57 +02:00
parent cc444fa207
commit 1385a22e60

View file

@ -143,19 +143,12 @@ export class BaseMessageTile extends SimpleTile {
if (!annotations) {
if (this._reactions) {
this._reactions = null;
this.emitChange("reactions");
}
}
let isNewMap = false;
if (!this._reactions) {
this._reactions = new ReactionsViewModel(this);
isNewMap = true;
}
this._reactions.update(annotations);
if (isNewMap) {
this.emitChange("reactions");
} else {
if (!this._reactions) {
this._reactions = new ReactionsViewModel(this);
}
this._reactions.update(annotations);
}
}
}