diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2020-10-17 17:43:46 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2020-10-17 17:43:46 -0400 |
| commit | 17ed1221ab453a664470a25d6bb6b0d203f934b7 (patch) | |
| tree | 53eaf99da5bb7dbae101c660c8bad002856906df /www/js/EventCtrl.js | |
| parent | 526572e49505d8f31865de14ef6c0437caca364d (diff) | |
apparently I forgot how to return promises #997
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index fa1c25b8..a2d57ed3 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -605,7 +605,8 @@ angular.module('zmApp.controllers') $state.go("app.login", { "wizard": false }); - return d.resolve(true); + d.resolve(true); + return d.promise; } $scope.events = []; @@ -752,12 +753,13 @@ angular.module('zmApp.controllers') NVR.debug("EventCtrl:loading one more page just in case we don't have enough to display"); loadMore() .then (function () { - return d.resolve(true); + d.resolve(true); + return d.promise; }); } else { - return d.resolve(true); - + d.resolve(true); + return d.promise; } }); return (d.promise); @@ -3090,16 +3092,19 @@ angular.module('zmApp.controllers') // the events API does not return an error for anything // except greater page limits than reported - //console.log("***** LOADING MORE INFINITE SCROLL ****"); var d = $q.defer(); + + + if ((currEventsPage >= maxEventsPage) && (pageLoaded)) { moreEvents = false; NVR.debug("No more - We have a total of " + maxEventsPage + " and are at page=" + currEventsPage); // console.log("*** At Page " + currEventsPage + " of " + maxEventsPage + ", not proceeding"); $ionicLoading.hide(); - return d.resolve(true); + d.resolve(true); + return d.promise; } currEventsPage++; @@ -3109,7 +3114,8 @@ angular.module('zmApp.controllers') $scope.$broadcast('scroll.infiniteScrollComplete'); // console.log("**** LOADMORE ARTIFICALLY DISABLED"); - return d.resolve(true); + d.resolve(true); + return d.promise; } var loadingStr = ""; @@ -3200,7 +3206,8 @@ angular.module('zmApp.controllers') //console.log("Got new page of events"); moreEvents = true; $scope.$broadcast('scroll.infiniteScrollComplete'); - return d.resolve(true); + d.resolve(true); + return d.promise; }, function (error) { @@ -3208,8 +3215,8 @@ angular.module('zmApp.controllers') moreEvents = false; $ionicLoading.hide(); $scope.$broadcast('scroll.infiniteScrollComplete'); - return d.resolve(true); - + d.resolve(true); + return (d.promise); }); return d.promise; } |
