File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -33,19 +33,24 @@ formsAngular.factory('recordHandler', function (
33
33
} ) . error ( handleError ) ;
34
34
} ;
35
35
36
- // FIXME: this method seems to be not used anymore
37
36
exports . scrollTheList = function ( $scope , handleError ) {
37
+ var pagesLoaded = $scope . pagesLoaded ;
38
38
SubmissionsService . getPagedAndFilteredList ( $scope . modelName , {
39
39
aggregate : $location . $$search . a ,
40
40
find : $location . $$search . f ,
41
41
limit : $scope . pageSize ,
42
- skip : $scope . pagesLoaded * $scope . pageSize ,
42
+ skip : pagesLoaded * $scope . pageSize ,
43
43
order : $location . $$search . o
44
44
} )
45
45
. success ( function ( data ) {
46
46
if ( angular . isArray ( data ) ) {
47
- $scope . pagesLoaded ++ ;
48
- $scope . recordList = $scope . recordList . concat ( data ) ;
47
+ // I have seen an intermittent problem where a page is requested twice
48
+ if ( pagesLoaded === $scope . pagesLoaded ) {
49
+ $scope . pagesLoaded ++ ;
50
+ $scope . recordList = $scope . recordList . concat ( data ) ;
51
+ } else {
52
+ console . log ( 'DEBUG: infinite scroll component asked for a page twice' ) ;
53
+ }
49
54
} else {
50
55
$scope . showError ( data , 'Invalid query' ) ;
51
56
}
You can’t perform that action at this time.
0 commit comments