From 2d4003379e7436453d19f9741f3ff688933c07a8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 8 Mar 2021 22:23:52 +0100 Subject: [PATCH] Fix #97 --- src/domain/session/room/timeline/tiles/SimpleTile.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/SimpleTile.js b/src/domain/session/room/timeline/tiles/SimpleTile.js index 17d16ab4..f63fde74 100644 --- a/src/domain/session/room/timeline/tiles/SimpleTile.js +++ b/src/domain/session/room/timeline/tiles/SimpleTile.js @@ -59,10 +59,13 @@ export class SimpleTile extends ViewModel { // TilesCollection contract below setUpdateEmit(emitUpdate) { this.updateOptions({emitChange: paramName => { + // it can happen that after some network call + // we switched away from the room and the response + // comes in, triggering an emitChange in a tile that + // has been disposed already (and hence the change + // callback has been cleared by dispose) We should just ignore this. if (emitUpdate) { emitUpdate(this, paramName); - } else { - console.trace("Tile is emitting event after being disposed"); } }}); }