Skip to content

Commit

Permalink
Stopping the infinite stream when no data is available anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Dec 11, 2016
1 parent 1c6e387 commit 00861bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/angular/stream.js
Expand Up @@ -9,10 +9,11 @@ Rapidoid.plugin(function(app) {
this.lastId = '';
this.dataUrl = dataUrl;
this.cols = 1;
this.reachedEnd = false;
};

StreamData.prototype.nextPage = function() {
if (this.busy)
if (this.busy || this.reachedEnd)
return;
this.busy = true;

Expand All @@ -26,6 +27,7 @@ Rapidoid.plugin(function(app) {
}
this.page++;
this.busy = false;
this.reachedEnd = items.length == 0;
}.bind(this));
};

Expand Down

0 comments on commit 00861bb

Please sign in to comment.