forked from mystiq/hydrogen-web
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
49752a0e7c
commit
a488ff143e
1 changed files with 5 additions and 9 deletions
|
@ -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 a new issue