Skip to content

Commit

Permalink
Fix wrong agent id parsing when come from groups twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesús Ángel González authored and havidarou committed Feb 22, 2018
1 parent 32b4620 commit 188793b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/controllers/agents.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function ($scope, $location, $q, $rootScope, appState, genericReq, apiReq, Agent
id = newAgentId;
$location.search('agent', id);
} else {
if ($location.search().agent) { // There's one in the url
if ($location.search().agent && !$rootScope.globalAgent) { // There's one in the url
id = $location.search().agent;
} else { // We pick the one in the rootScope
id = $rootScope.globalAgent;
Expand Down Expand Up @@ -288,7 +288,7 @@ function ($scope, $location, $q, $rootScope, appState, genericReq, apiReq, Agent
$scope.configurationError = false;
$scope.load = true;
let id;
if ($location.search().agent) { // There's one in the url
if ($location.search().agent && !$rootScope.globalAgent) { // There's one in the url
id = $location.search().agent;
} else { // We pick the one in the rootScope
id = $rootScope.globalAgent;
Expand Down

0 comments on commit 188793b

Please sign in to comment.