From c6848e3f1dbb61853d70a08061e630f4e183ac02 Mon Sep 17 00:00:00 2001 From: hashishaw Date: Wed, 9 Mar 2022 12:33:39 -0600 Subject: [PATCH] Fix ordering --- ui/app/routes/vault/cluster.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/app/routes/vault/cluster.js b/ui/app/routes/vault/cluster.js index f613e8c0991b..9f80e82e7d91 100644 --- a/ui/app/routes/vault/cluster.js +++ b/ui/app/routes/vault/cluster.js @@ -53,12 +53,7 @@ export default Route.extend(ModelBoundaryRoute, ClusterRoute, { // eslint-disable-next-line no-console console.error('Cannot use Cloud Admin Namespace flag with OSS Vault'); } - if (typeof managedRoot === 'string') { - let managed = getManagedNamespace(namespace, managedRoot); - if (managed !== namespace) { - this.transitionTo({ queryParams: { namespace: managed } }); - } - } else if (!namespace && currentTokenName && !Ember.testing) { + if (!namespace && currentTokenName && !Ember.testing) { // if no namespace queryParam and user authenticated, // use user's root namespace to redirect to properly param'd url const storage = getStorage().getItem(currentTokenName); @@ -67,6 +62,11 @@ export default Route.extend(ModelBoundaryRoute, ClusterRoute, { if (namespace) { this.transitionTo({ queryParams: { namespace } }); } + } else if (managedRoot !== null) { + let managed = getManagedNamespace(namespace, managedRoot); + if (managed !== namespace) { + this.transitionTo({ queryParams: { namespace: managed } }); + } } this.namespaceService.setNamespace(namespace); const id = this.getClusterId(params);