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);
|
const newTile = this._createTile(entry);
|
||||||
if (newTile) {
|
if (newTile) {
|
||||||
if (prevTile) {
|
prevTile?.updateNextSibling(newTile);
|
||||||
prevTile.updateNextSibling(newTile);
|
// this emits an update while the add hasn't been emitted yet
|
||||||
// this emits an update while the add hasn't been emitted yet
|
newTile.updatePreviousSibling(prevTile);
|
||||||
newTile.updatePreviousSibling(prevTile);
|
newTile.updateNextSibling(nextTile);
|
||||||
}
|
nextTile?.updatePreviousSibling(newTile);
|
||||||
if (nextTile) {
|
|
||||||
newTile.updateNextSibling(nextTile);
|
|
||||||
nextTile.updatePreviousSibling(newTile);
|
|
||||||
}
|
|
||||||
this._tiles.splice(tileIdx, 0, newTile);
|
this._tiles.splice(tileIdx, 0, newTile);
|
||||||
this.emitAdd(tileIdx, newTile);
|
this.emitAdd(tileIdx, newTile);
|
||||||
// add event is emitted, now the tile
|
// add event is emitted, now the tile
|
||||||
|
|
Reference in a new issue