forked from mystiq/hydrogen-web
add some comments and rename for clarity
This commit is contained in:
parent
a4cd40c2f8
commit
781147bf0e
1 changed files with 10 additions and 5 deletions
|
@ -49,13 +49,15 @@ export class GapTile extends SimpleTile {
|
||||||
}
|
}
|
||||||
|
|
||||||
async notifyVisible() {
|
async notifyVisible() {
|
||||||
|
// we do (up to 10) backfills while no new tiles have been added to the timeline
|
||||||
|
// because notifyVisible won't be called again until something gets added to the timeline
|
||||||
let depth = 0;
|
let depth = 0;
|
||||||
let result;
|
let canFillMore;
|
||||||
do {
|
|
||||||
result = await this.fill();
|
|
||||||
depth = depth + 1;
|
|
||||||
} while (depth < 10 && !this._siblingChanged && result && !this.isDisposed)
|
|
||||||
this._siblingChanged = false;
|
this._siblingChanged = false;
|
||||||
|
do {
|
||||||
|
canFillMore = await this.fill();
|
||||||
|
depth = depth + 1;
|
||||||
|
} while (depth < 10 && !this._siblingChanged && canFillMore && !this.isDisposed);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isAtTop() {
|
get isAtTop() {
|
||||||
|
@ -73,6 +75,9 @@ export class GapTile extends SimpleTile {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateNextSibling() {
|
updateNextSibling() {
|
||||||
|
// if the sibling of the gap changed while calling room.fill(),
|
||||||
|
// we intepret this as at least one new tile has been added to
|
||||||
|
// the timeline. See notifyVisible why this is important.
|
||||||
this._siblingChanged = true;
|
this._siblingChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue