diff --git a/ui-v2/app/helpers/href-mut.js b/ui-v2/app/helpers/href-mut.js
index 6ad337df16..6353d44069 100644
--- a/ui-v2/app/helpers/href-mut.js
+++ b/ui-v2/app/helpers/href-mut.js
@@ -22,7 +22,7 @@ export default Helper.extend({
atts = atts.concat(getRouteParams(parent, params));
current = parent;
}
- let route = this.router.currentRouteName;
+ let route = this.router.currentRoute.name;
// TODO: this is specific to consul/nspaces
// 'ideally' we could try and do this elsewhere
// not super important though.
diff --git a/ui-v2/app/routes/application.js b/ui-v2/app/routes/application.js
index d815090bb7..c66cf4bf7f 100644
--- a/ui-v2/app/routes/application.js
+++ b/ui-v2/app/routes/application.js
@@ -51,6 +51,8 @@ export default Route.extend(WithBlockingActions, {
error = e.errors[0];
error.message = error.title || error.detail || 'Error';
}
+ // Try and get the currently attempted dc, whereever that may be
+ const model = this.modelFor('dc') || this.modelFor('nspace.dc');
// TODO: Unfortunately ember will not maintain the correct URL
// for you i.e. when this happens the URL in your browser location bar
// will be the URL where you clicked on the link to come here
@@ -62,7 +64,6 @@ export default Route.extend(WithBlockingActions, {
// 403 page
// To note: Consul only gives you back a 403 if a non-existent token has been sent in the header
// if a token has not been sent at all, it just gives you a 200 with an empty dataset
- const model = this.modelFor('dc');
if (error.status === '403') {
return this.feedback.execute(() => {
return this.settings.delete('token').then(() => {
@@ -85,7 +86,8 @@ export default Route.extend(WithBlockingActions, {
: { Name: 'Error' },
dcs: model && model.dcs ? model.dcs : [],
})
- .then(model => {
+ .then(model => Promise.all([model, this.repo.clearActive()]))
+ .then(([model]) => {
removeLoading($root);
model.nspaces = [model.nspace];
// we can't use setupController as we received an error
diff --git a/ui-v2/app/services/repository/dc.js b/ui-v2/app/services/repository/dc.js
index 09654c7681..76d0957ab1 100644
--- a/ui-v2/app/services/repository/dc.js
+++ b/ui-v2/app/services/repository/dc.js
@@ -43,4 +43,7 @@ export default RepositoryService.extend({
}
);
},
+ clearActive: function() {
+ return this.settings.delete('dc');
+ },
});
diff --git a/ui-v2/app/templates/error.hbs b/ui-v2/app/templates/error.hbs
index cc1244d5c2..bcf13457f5 100644
--- a/ui-v2/app/templates/error.hbs
+++ b/ui-v2/app/templates/error.hbs
@@ -15,7 +15,7 @@
You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.
Try looking in our documentation