From e1b9b1161deda9da7e9159f1c150a62a03a50438 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 13 Jan 2022 20:35:26 +0530 Subject: [PATCH] Split ifs and remove ?. abuse --- src/domain/session/room/timeline/tiles/BaseMessageTile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/BaseMessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js index 0691fbe7..ddd66fdf 100644 --- a/src/domain/session/room/timeline/tiles/BaseMessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -117,15 +117,15 @@ export class BaseMessageTile extends SimpleTile { updateEntry(entry, param) { const replyEntry = entry.contextEntry; - if (replyEntry) { + if (replyEntry && this._replyTile) { // this is an update to contextEntry used for replyPreview - const action = this._replyTile?.updateEntry(replyEntry); + const action = this._replyTile.updateEntry(replyEntry); if (action?.shouldReplace) { this.disposeTracked(this._replyTile); this._replyTile = this._tileCreator(replyEntry); } - else { - this._replyTile?.emitChange(); + if(action?.shouldUpdate) { + this._replyTile.emitChange(); } } const action = super.updateEntry(entry, param);