fix(infiniteScroll): ensure infinite doesn't fire when already loading

This commit is contained in:
Adam Bradley
2016-05-31 22:07:37 -05:00
parent d57833c81b
commit f7b1f373d3

View File

@ -178,8 +178,10 @@ export class InfiniteScroll {
let distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - reloadY; let distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - reloadY;
if (distanceFromInfinite < 0) { if (distanceFromInfinite < 0) {
this._zone.run(() => { this._zone.run(() => {
this.state = STATE_LOADING; if (this.state !== STATE_LOADING && this.state !== STATE_DISABLED) {
this.ionInfinite.emit(this); this.state = STATE_LOADING;
this.ionInfinite.emit(this);
}
}); });
return 5; return 5;
} }