mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
also always update siblings when adding an entry,even when there is none
otherwise the first item in the list won't have a date separator
This commit is contained in:
parent
7cdb6e528f
commit
90d0fd1f89
@ -130,15 +130,11 @@ export class TilesCollection extends BaseObservableList {
|
||||
|
||||
const newTile = this._createTile(entry);
|
||||
if (newTile) {
|
||||
if (prevTile) {
|
||||
prevTile.updateNextSibling(newTile);
|
||||
// this emits an update while the add hasn't been emitted yet
|
||||
newTile.updatePreviousSibling(prevTile);
|
||||
}
|
||||
if (nextTile) {
|
||||
newTile.updateNextSibling(nextTile);
|
||||
nextTile.updatePreviousSibling(newTile);
|
||||
}
|
||||
prevTile?.updateNextSibling(newTile);
|
||||
// this emits an update while the add hasn't been emitted yet
|
||||
newTile.updatePreviousSibling(prevTile);
|
||||
newTile.updateNextSibling(nextTile);
|
||||
nextTile?.updatePreviousSibling(newTile);
|
||||
this._tiles.splice(tileIdx, 0, newTile);
|
||||
this.emitAdd(tileIdx, newTile);
|
||||
// add event is emitted, now the tile
|
||||
|
Loading…
Reference in New Issue
Block a user