Add timeout for empty rotation GET requests

Resolve bug #12
This commit is contained in:
Aarni
2017-01-10 19:12:35 +02:00
parent d4de01289a
commit 42d64f6431
@@ -10,7 +10,12 @@ app.controller('infoscreen_main', function($scope,$http,$timeout){
$scope.index = -1;
$http.get('/infoscreen/rotation/'+$scope.rotation, {timeout:5000}).then(function(response){
templates = response.data.instances;
$scope.next();
if (templates.length == 0) {
$timeout(get_rotation, 10000);
}
else {
$scope.next();
}
},function(response){
$timeout(get_rotation, 10000);
});