Skip to content

Commit

Permalink
Fix ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
hashishaw committed Mar 9, 2022
1 parent 8917416 commit c6848e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ui/app/routes/vault/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit c6848e3

Please sign in to comment.