Remove debug code

Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
RMidhunSuresh 2021-10-26 14:29:03 +05:30
parent b648b87687
commit ebafd8c42b
2 changed files with 9 additions and 12 deletions

View file

@ -49,8 +49,7 @@ export class TimelineViewModel extends ViewModel {
this._showJumpDown = false; this._showJumpDown = false;
} }
async watchForGapFill(gapPromise, tileRange, gapTile) { async watchForGapFill(gapPromise, gapTile) {
console.log("watchForGapFill called");
let hasSeenUpdate = false; let hasSeenUpdate = false;
const func = (idx, tile) => { const func = (idx, tile) => {
if (tile.shape !== "gap") { if (tile.shape !== "gap") {
@ -63,13 +62,13 @@ export class TimelineViewModel extends ViewModel {
onRemove: (idx, tile) => func(idx, tile) onRemove: (idx, tile) => func(idx, tile)
}; };
this.tiles.subscribe(subscription); this.tiles.subscribe(subscription);
await gapPromise; const gapResult = await gapPromise;
if (!gapResult) {
return;
}
this.tiles.unsubscribe(subscription); this.tiles.unsubscribe(subscription);
console.log("hasSeenUpdate is ", hasSeenUpdate);
if (!hasSeenUpdate) { if (!hasSeenUpdate) {
// this.watchForGapFill(gapTile.notifyVisible(), undefined, gapTile); this.watchForGapFill(gapTile.notifyVisible(), gapTile);
const { startTile, endTile } = tileRange;
this.setVisibleTileRange(startTile, endTile);
} }
} }
@ -99,8 +98,7 @@ export class TimelineViewModel extends ViewModel {
for (const tile of this._tiles.sliceIterator(startIndex, endIndex + 1)) { for (const tile of this._tiles.sliceIterator(startIndex, endIndex + 1)) {
const ret = tile.notifyVisible(); const ret = tile.notifyVisible();
if (ret && !tile.isAtTop) { if (ret && !tile.isAtTop) {
console.log("ret is", ret); this.watchForGapFill(ret, tile);
this.watchForGapFill(ret, { startTile, endTile }, tile);
} }
} }
loadTop = startIndex < 10; loadTop = startIndex < 10;

View file

@ -42,10 +42,9 @@ export class GapTile extends SimpleTile {
this._loading = false; this._loading = false;
this.emitChange("isLoading"); this.emitChange("isLoading");
} }
return true;
} }
else { return false;
console.log("Not entering fill() logic");
}
} }
notifyVisible() { notifyVisible() {