Skip to content

Commit

Permalink
fix(dashboard): fix refresh on server change
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed May 2, 2016
1 parent e48a71a commit 37cdf4c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/app/dashboard/DashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,14 @@
}).then(function(popover) {
popover.scope.selectServer = function(server) {
popover.hide();
resetData();
updateDonuts();
updateDonuts.flush();
$scope.server = server;
//$ionicLoading.show({templateUrl: loadingTemplate, duration: 20000});
Servers.setDefault(server);
if ($scope.server && $scope.server._id !== server._id) {
resetData();
updateDonuts();
updateDonuts.flush();
//$scope.server = server;
//$ionicLoading.show({templateUrl: loadingTemplate, duration: 20000});
Servers.setDefault(server);
}
};
return popover;
});
Expand All @@ -462,7 +464,7 @@

util.onDefaultServerUpdated(function(defaultServer) {
//$log.debug('DashboardController.onDefaultServerUpdated: ' + angular.toJson(defaultServer));
if (angular.equals(defaultServer, $scope.server)) {
if ($scope.server && defaultServer && defaultServer._id && defaultServer._id === $scope.server._id) {
$log.debug('DashboardController.defaultServerUpdated: server is unchanged.');
return;
}
Expand Down

0 comments on commit 37cdf4c

Please sign in to comment.