Skip to content

Commit

Permalink
#704 make sure all state gos are after getMonitor returns - in case
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Sep 13, 2018
1 parent b8c72c8 commit b4912a7
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions www/js/MenuController.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,25 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io

},
function (error) {
var refresh = NVRDataModel.getMonitors(1);
console.log ("+++ state go after API version error: "+error);
$rootScope.apiVersion = "0.0.0";
NVRDataModel.debug("Error, failed API version, setting to " + $rootScope.apiVersion);
var refresh = NVRDataModel.getMonitors(1)
.then (function() {
console.log ("+++ state go after API version error: "+error);
$rootScope.apiVersion = "0.0.0";
NVRDataModel.debug("Error, failed API version, setting to " + $rootScope.apiVersion);

$ionicHistory.nextViewOptions({
disableBack: true
});


$state.go('app.refresh', {
"view": $state.current.name
});
return;

$ionicHistory.nextViewOptions({
disableBack: true
});


$state.go('app.refresh', {
"view": $state.current.name
});
return;

});

Expand Down Expand Up @@ -192,17 +197,21 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io

},
function (error) {
var refresh = NVRDataModel.getMonitors(1);
$rootScope.apiVersion = "0.0.0";
NVRDataModel.debug("Error, failed API version, setting to " + $rootScope.apiVersion);
$ionicHistory.nextViewOptions({
disableBack: true
});
console.log ("+++ state go after API version force");
$state.go('app.refresh', {
"view": $state.current.name
var refresh = NVRDataModel.getMonitors(1)
.then (function() {
$rootScope.apiVersion = "0.0.0";
NVRDataModel.debug("Error, failed API version, setting to " + $rootScope.apiVersion);
$ionicHistory.nextViewOptions({
disableBack: true
});
console.log ("+++ state go after API version force");
$state.go('app.refresh', {
"view": $state.current.name
});
return;

});
return;

});

});
Expand Down

0 comments on commit b4912a7

Please sign in to comment.