diff --git a/src/domain/session/room/timeline/tiles/BaseMessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js index 091ef518..ae447b3c 100644 --- a/src/domain/session/room/timeline/tiles/BaseMessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -28,6 +28,7 @@ export class BaseMessageTile extends SimpleTile { if (this._entry.annotations || this._entry.pendingAnnotations) { this._updateReactions(); } + this._updateReplyTileIfNeeded(options.tilesCreator); } get _mediaRepository() { @@ -116,6 +117,15 @@ export class BaseMessageTile extends SimpleTile { } updateEntry(entry, param, tilesCreator) { + this._updateReplyTileIfNeeded(tilesCreator); + const action = super.updateEntry(entry, param, tilesCreator); + if (action.shouldUpdate) { + this._updateReactions(); + } + return action; + } + + _updateReplyTileIfNeeded(tilesCreator) { const replyEntry = entry.contextEntry; if (replyEntry) { // this is an update to contextEntry used for replyPreview @@ -128,11 +138,6 @@ export class BaseMessageTile extends SimpleTile { this._replyTile?.emitChange(); } } - const action = super.updateEntry(entry, param, tilesCreator); - if (action.shouldUpdate) { - this._updateReactions(); - } - return action; } startReply() { diff --git a/src/domain/session/room/timeline/tilesCreator.js b/src/domain/session/room/timeline/tilesCreator.js index 9dde00a2..dc9a850e 100644 --- a/src/domain/session/room/timeline/tilesCreator.js +++ b/src/domain/session/room/timeline/tilesCreator.js @@ -28,8 +28,8 @@ import {EncryptionEnabledTile} from "./tiles/EncryptionEnabledTile.js"; import {MissingAttachmentTile} from "./tiles/MissingAttachmentTile.js"; export function tilesCreator(baseOptions) { - return function tilesCreator(entry, emitUpdate) { - const options = Object.assign({entry, emitUpdate}, baseOptions); + const tilesCreator = function tilesCreator(entry, emitUpdate) { + const options = Object.assign({entry, emitUpdate, tilesCreator}, baseOptions); if (entry.isGap) { return new GapTile(options); } else if (entry.isPending && entry.pendingEvent.isMissingAttachments) { @@ -76,5 +76,6 @@ export function tilesCreator(baseOptions) { return null; } } - } + }; + return tilesCreator; }