fix repository reload got error in remove tags

When I remove all tags, removeTags() will reload and do initView() again, but data.tags response null, that trigger data.tags.length got error.
pull/2545/head
hiyao 2018-12-12 18:06:38 +08:00 committed by GitHub
parent 6b05a35881
commit 5d9b1778ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -81,9 +81,17 @@ angular.module('portainer.app')
});
return $q.all(promises);
})
.then(function success() {
.then(function success(data) {
Notifications.success('Success', 'Tags successfully deleted');
$state.reload();
if (data.length === 0) {
$state.go('portainer.registries.registry.repositories', {
id: $scope.registryId
}, {
reload: true
});
} else {
$state.reload();
}
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to delete tags');