From 9dbd8fa9f7066ed0753479ebc640d4c83305774d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20=C3=81ngel=20Gonz=C3=A1lez?= Date: Thu, 7 Jun 2018 10:15:32 +0200 Subject: [PATCH] Reduced vis tab checking to 2 elements --- public/controllers/agents.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/controllers/agents.js b/public/controllers/agents.js index 79422b579..68cabb2f2 100644 --- a/public/controllers/agents.js +++ b/public/controllers/agents.js @@ -43,7 +43,7 @@ app.controller('agentsController', function ($timeout, $scope, $location, $rootS $scope.tab = "general"; $location.search("tab", "general"); } - tabHistory.push($scope.tab) + if($scope.tab !== 'configuration' && $scope.tab !== 'welcome') tabHistory.push($scope.tab) // Metrics Audit const metricsAudit = { @@ -214,14 +214,14 @@ app.controller('agentsController', function ($timeout, $scope, $location, $rootS // Switch tab $scope.switchTab = (tab, force = false) => { - tabHistory.push(tab) - if (tabHistory.length > 3) tabHistory = tabHistory.slice(-3); + if(tab !== 'configuration' && tab !== 'welcome') tabHistory.push(tab) + if (tabHistory.length > 2) tabHistory = tabHistory.slice(-2); tabVisualizations.setTab(tab); if ($scope.tab === tab && !force) return; const onlyAgent = $scope.tab === tab && force; const sameTab = $scope.tab === tab; $location.search('tab', tab); - const preserveDiscover = tabHistory.length === 3 && tabHistory[0] === tabHistory[2] && tabHistory[1] === 'configuration'; + const preserveDiscover = tabHistory.length === 2 && tabHistory[0] === tabHistory[1]; $scope.tab = tab; if($scope.tab === 'configuration'){