Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes #10721: Redirect to manifest import consistently if no subscrip…
…tions.
  • Loading branch information
ehelms committed Aug 7, 2015
1 parent 09b46e6 commit 2c38e06
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -18,8 +18,8 @@
* within the table.
*/
angular.module('Bastion.subscriptions').controller('SubscriptionsController',
['$scope', '$filter', '$q', '$location', 'translate', 'Nutupane', 'Subscription', 'Organization', 'CurrentOrganization', 'SubscriptionsHelper',
function ($scope, $filter, $q, $location, translate, Nutupane, Subscription, Organization, CurrentOrganization, SubscriptionsHelper) {
['$scope', '$filter', '$location', 'translate', 'Nutupane', 'Subscription', 'Organization', 'CurrentOrganization', 'SubscriptionsHelper',
function ($scope, $filter, $location, translate, Nutupane, Subscription, Organization, CurrentOrganization, SubscriptionsHelper) {
var params, nutupane;

params = {
Expand Down Expand Up @@ -63,10 +63,12 @@ angular.module('Bastion.subscriptions').controller('SubscriptionsController',

$scope.subscriptions = Subscription.queryPaged();

$q.all([$scope.subscriptions.$promise]).then(function () {
if ($scope.subscriptions.results.length < 1) {
$scope.transitionTo('subscriptions.manifest.import');
}
$scope.$on('$stateChangeSuccess', function () {
$scope.subscriptions.$promise.then(function () {
if ($scope.subscriptions.results.length < 1) {
$scope.transitionTo('subscriptions.manifest.import');
}
});
});
}]
);

0 comments on commit 2c38e06

Please sign in to comment.