Skip to content

Commit

Permalink
fix(templates): redirect to home if endpoint not yet selected #2709 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
linquize authored and deviantony committed Feb 13, 2019
1 parent fdc11db commit 8f32d58
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/portainer/__module.js
Expand Up @@ -457,6 +457,16 @@ angular.module('portainer.app', [])
var templates = {
name: 'portainer.templates',
url: '/templates',
resolve: {
endpointID: ['EndpointProvider', '$state',
function (EndpointProvider, $state) {
var id = EndpointProvider.endpointID();
if (!id) {
return $state.go('portainer.home');
}
}
]
},
views: {
'content@': {
templateUrl: 'app/portainer/views/templates/templates.html',
Expand Down

0 comments on commit 8f32d58

Please sign in to comment.