Skip to content

Commit

Permalink
#1067 make sure we don't get stuck in a loop between ZM groups and mo…
Browse files Browse the repository at this point in the history
…ntage profiles
  • Loading branch information
pliablepixels committed May 26, 2021
1 parent 09ffc96 commit deb2e03
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
27 changes: 24 additions & 3 deletions www/js/MontageCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,21 @@ angular.module('zmApp.controllers')

$scope.selectZMGroup = function() {


$scope.tempZMGroups = [];
var ld = NVR.getLogin();


if (ld.currentMontageProfile != $translate.instant('kMontageDefaultProfile') && ld.currentMontageProfile) {
$rootScope.zmPopup = $ionicPopup.alert({
title: $translate.instant('kError'),
template: $translate.instant('kErrorZMGroupMontageProfile') + $translate.instant('kMontageDefaultProfile'),

});
return;
}


for (var i=0; i < $scope.zmGroups.length; i++) {
var val = ld.currentZMGroupNames.includes($scope.zmGroups[i])? true:false;
$scope.tempZMGroups.push ({
Expand Down Expand Up @@ -1975,11 +1987,20 @@ angular.module('zmApp.controllers')
}
// switch to another montage profile
$scope.switchMontageProfile = function () {



var posArray;
var i;
var ld = NVR.getLogin();

if ($scope.currentZMGroupName &&
(ld.currentMontageProfile != $translate.instant('kMontageDefaultProfile') ||
ld.currentMontageProfile)) {
NVR.debug ('Resetting currentZMGroupName - this is hopefully a one time thing');
$scope.currentZMGroupName='';
ld.currentZMGroupName='';
ld.currentZMGroupNames = [];
NVR.setLogin(ld);
}


if ($scope.currentZMGroupName) {
$rootScope.zmPopup = $ionicPopup.alert({
Expand Down
3 changes: 2 additions & 1 deletion www/lang/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
"kErrorRetrievingFrames" :"error retrieving frames",
"kErrorRetrievingState" :"error retrieving state",
"kErrorSave" :"Error - could not save",
"kErrorMontageProfileZMGroup":"Montage profiles cannot be switched with a ZM group is active",
"kErrorMontageProfileZMGroup":"Montage profiles cannot be switched when a ZM group is active",
"kErrorZMGroupMontageProfile":"ZM groups cannot be switched when a Montage Profile is active. Please switch to: ",
"kEvent" :"event",
"kEventDeleteConfirm" :"Are you sure you want to delete Event:",
"kEventHistHrs" :"hours ago",
Expand Down

0 comments on commit deb2e03

Please sign in to comment.