From 1d33ab20a59da23027b6aaf4701b67bf333d780b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 18 Sep 2020 13:36:16 +0200 Subject: [PATCH] fix decrypted tiles not corresponding to a tile --- src/domain/session/room/timeline/TilesCollection.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/domain/session/room/timeline/TilesCollection.js b/src/domain/session/room/timeline/TilesCollection.js index c2d9df5d..cf46899a 100644 --- a/src/domain/session/room/timeline/TilesCollection.js +++ b/src/domain/session/room/timeline/TilesCollection.js @@ -145,7 +145,12 @@ export class TilesCollection extends BaseObservableList { if (tile) { const action = tile.updateEntry(entry, params); if (action.shouldReplace) { - this._replaceTile(tileIdx, tile, this._tileCreator(entry)); + const newTile = this._tileCreator(entry); + if (newTile) { + this._replaceTile(tileIdx, tile, newTile); + } else { + this._removeTile(tileIdx, tile); + } } if (action.shouldRemove) { this._removeTile(tileIdx, tile);