From 6a857a3bf98441259002b6db7ac1d0a87b4e840f Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Tue, 17 Nov 2015 17:02:37 -0500 Subject: #93 - empty monitor list check Former-commit-id: 3635f10308af6dc459db2d36d7f158488407b35a --- www/js/EventCtrl.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'www/js/EventCtrl.js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 7ebc764b..beadd18b 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -163,6 +163,21 @@ angular.module('zmApp.controllers') $scope.monitors = ZMDataModel.applyMontageMonitorPrefs(tempMon, 2)[0]; } else $scope.monitors = message; + + + if ($scope.monitors.length == 0) + { + $ionicPopup.alert({ + title: "No Monitors found", + template: "Please check your credentials" + }); + $ionicHistory.nextViewOptions({ + disableBack: true + }); + $state.go("login"); + return; + } + // console.log ("********** GOT MONITORS " + JSON.stringify($scope.monitors)); //$scope.monitors = message; -- cgit v1.2.3