This commit is contained in:
Bruno Windels 2021-03-08 22:23:52 +01:00
parent 2a106c5053
commit 2d4003379e

View File

@ -59,10 +59,13 @@ export class SimpleTile extends ViewModel {
// TilesCollection contract below // TilesCollection contract below
setUpdateEmit(emitUpdate) { setUpdateEmit(emitUpdate) {
this.updateOptions({emitChange: paramName => { 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) { if (emitUpdate) {
emitUpdate(this, paramName); emitUpdate(this, paramName);
} else {
console.trace("Tile is emitting event after being disposed");
} }
}}); }});
} }