summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2020-10-17 17:43:46 -0400
committerPliable Pixels <pliablepixels@gmail.com>2020-10-17 17:43:46 -0400
commit17ed1221ab453a664470a25d6bb6b0d203f934b7 (patch)
tree53eaf99da5bb7dbae101c660c8bad002856906df /www
parent526572e49505d8f31865de14ef6c0437caca364d (diff)
apparently I forgot how to return promises #997
Diffstat (limited to 'www')
-rw-r--r--www/js/EventCtrl.js27
-rw-r--r--www/js/WizardCtrl.js13
2 files changed, 25 insertions, 15 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;
}
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js
index 897ffa18..119089d8 100644
--- a/www/js/WizardCtrl.js
+++ b/www/js/WizardCtrl.js
@@ -782,12 +782,14 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
.then(function (success) {
$ionicLoading.hide();
// return true here because we want to progress
- return d.resolve(true);
+ d.resolve(true);
+ return d.promise;
},
function (error) {
$ionicLoading.hide();
// return true here because we want to progress
- return d.resolve(true);
+ d.resolve(true);
+ return d.promise;
});
},
function (error) {
@@ -795,7 +797,8 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
NVR.log("zmWizard: api failed");
// return true here because we want to progress
- return d.resolve(true);
+ d.resolve(true);
+ return d.promise;
});
},
@@ -806,8 +809,8 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
NVR.log("zmWizard: login failed");
$scope.wizard.portalValidText = $translate.instant('kPortalLoginUnsuccessful');
$scope.wizard.portalColor = "#e74c3c";
- return d.resolve(true);
-
+ d.resolve(true);
+ return d.promise;
});
}); //finally