Since these grids have caching, if the offset was greater
the cached data length, the grid would try to fetch data again, even if
it's already there, pushing duplicate items into the cache. This should
prevent that.
Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
egCore.auth.token(), $scope.patron_id
).then(function(hold_ids) {
- if (!hold_ids.length) { deferred.resolve(); return; }
+ if (!hold_ids.length || hold_ids.length < offset + 1) { deferred.resolve(); return; }
patronSvc.hold_ids = hold_ids;
fetchHolds(offset, count)
$scope.gridDataProvider = provider;
function fetch_circs(id_list, offset, count) {
- if (!id_list.length) return $q.when();
+ if (!id_list.length || id_list.length < offset + 1) return $q.when();
var deferred = $q.defer();
var rendered = 0;