mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
don't fail when insert first or appending a tile
This commit is contained in:
parent
1ed3babfec
commit
674007d892
@ -88,8 +88,8 @@ export default class TilesCollection extends BaseObservableList {
|
|||||||
|
|
||||||
const newTile = this._tileCreator(entry);
|
const newTile = this._tileCreator(entry);
|
||||||
if (newTile) {
|
if (newTile) {
|
||||||
prevTile.updateNextSibling(newTile);
|
prevTile && prevTile.updateNextSibling(newTile);
|
||||||
nextTile.updatePreviousSibling(newTile);
|
nextTile && nextTile.updatePreviousSibling(newTile);
|
||||||
this._tiles.splice(tileIdx, 0, newTile);
|
this._tiles.splice(tileIdx, 0, newTile);
|
||||||
this.emitAdd(tileIdx, newTile);
|
this.emitAdd(tileIdx, newTile);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user