diff --git a/infoscreen/static/js/infoscreen_controllers.js b/infoscreen/static/js/infoscreen_controllers.js index b5e518a..2df55b7 100644 --- a/infoscreen/static/js/infoscreen_controllers.js +++ b/infoscreen/static/js/infoscreen_controllers.js @@ -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); });