mirror of
https://github.com/status-im/consul.git
synced 2025-03-02 06:10:44 +00:00
ui: Passthrough any error from a route:application refresh (#8480)
This commit is contained in:
parent
6dbdc8d69b
commit
1088766d85
@ -41,12 +41,19 @@ export default Controller.extend({
|
|||||||
const container = getOwner(this);
|
const container = getOwner(this);
|
||||||
const routeName = this.router.currentRoute.name;
|
const routeName = this.router.currentRoute.name;
|
||||||
const route = container.lookup(`route:${routeName}`);
|
const route = container.lookup(`route:${routeName}`);
|
||||||
// Refresh the application route
|
// Refresh the application route as everything including the main nav needs refreshing
|
||||||
return container
|
return container
|
||||||
.lookup('route:application')
|
.lookup('route:application')
|
||||||
.refresh()
|
.refresh()
|
||||||
.promise.then(res => {
|
.promise.catch(function(e) {
|
||||||
|
// passthrough
|
||||||
|
// if you are on an error page a refresh of the application route will reject
|
||||||
|
// thats ok as we then transition to the actual route you were trying
|
||||||
|
// to get to originally anyway
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
// Use transitionable if we need to change a section of the URL
|
// Use transitionable if we need to change a section of the URL
|
||||||
|
// or routeName and currentRouteName aren't equal (i.e. error page)
|
||||||
if (
|
if (
|
||||||
routeName !== this.router.currentRouteName ||
|
routeName !== this.router.currentRouteName ||
|
||||||
typeof params.nspace !== 'undefined'
|
typeof params.nspace !== 'undefined'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user