Skip to content

Commit

Permalink
feat(dashboard): auto-refresh availability if "Calculating..."
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Apr 7, 2016
1 parent 56395ef commit 60a4824
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/dashboard/DashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,19 @@

if (update.success) {
$scope.availability = update.contents;
for (var i=0, len=$scope.availability.length, section; i < len; i++) {
section = $scope.availability[i];
for (var c=0, clen=section.categories.length, category; c < clen; c++) {
category = section.categories[c];
if (category.outageText.contains('Calculating')) {
$log.debug('Availability is still calculating... refreshing in 5 seconds.');
$timeout(function() {
DashboardService.refreshAvailability();
}, 5000);
return;
}
}
}
} else {
resetAvailability();
}
Expand Down

0 comments on commit 60a4824

Please sign in to comment.