From 46168f2d1551514414beda6fc7ffe25eb67d8553 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Tue, 17 Nov 2015 16:55:12 -0500 Subject: #93 - if monitors is empty redirect to login as user may not have access to view any monitors Former-commit-id: ae3488eef88d4977c211f0f310822ba3d39fef2b --- www/js/MontageCtrl.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'www') diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 5a3ef4f9..fed99b9e 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -40,6 +40,19 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' var hiddenOrder = []; // 1 = hide, 0 = don't hide var tempMonitors = message; + if (tempMonitors.length == 0) + { + $ionicPopup.alert({ + title: "No Monitors found", + template: "Please check your credentials" + }); + $ionicHistory.nextViewOptions({ + disableBack: true + }); + $state.go("login"); + return; + } + console.log ("TEMP MONITORS IS " + JSON.stringify(tempMonitors)); var tempResponse = ZMDataModel.applyMontageMonitorPrefs(message, 0); $scope.monitors = tempResponse[0]; -- cgit v1.2.3