mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
no need to store visible state on gap tile & don't fill if edge reached
This commit is contained in:
parent
ab67ac00b1
commit
98678b991b
@ -22,12 +22,10 @@ export class GapTile extends SimpleTile {
|
|||||||
super(options);
|
super(options);
|
||||||
this._loading = false;
|
this._loading = false;
|
||||||
this._error = null;
|
this._error = null;
|
||||||
this._visible = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fill() {
|
async fill() {
|
||||||
// prevent doing this twice
|
if (!this._loading && !this._entry.edgeReached) {
|
||||||
if (!this._loading) {
|
|
||||||
this._loading = true;
|
this._loading = true;
|
||||||
this.emitChange("isLoading");
|
this.emitChange("isLoading");
|
||||||
try {
|
try {
|
||||||
@ -44,13 +42,10 @@ export class GapTile extends SimpleTile {
|
|||||||
this.emitChange("isLoading");
|
this.emitChange("isLoading");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// edgeReached will have been updated by fillGap
|
|
||||||
return this._entry.edgeReached;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setVisible(isVisible) {
|
setVisible(isVisible) {
|
||||||
this._visible = isVisible;
|
if (isVisible) {
|
||||||
if (this._visible && !this.isLoading) {
|
|
||||||
this.fill();
|
this.fill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user