Ensure reload on transition from challeng edit -> detail

This commit is contained in:
Kevin Gisi
2015-04-12 00:04:49 -04:00
parent 50bbe5b2f5
commit ad6443c5b8

View File

@@ -94,12 +94,14 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
challenge.$save(function(_challenge){ challenge.$save(function(_challenge){
if (isNew) { if (isNew) {
Notification.text(window.env.t('challengeCreated')); Notification.text(window.env.t('challengeCreated'));
$state.go('options.social.challenges.detail', {cid: _challenge._id}); $state.transitionTo('options.social.challenges.detail', {cid: challenge._id}, {
$scope.discard(); reload: true, inherit: false, notify: true
$scope.challenges = Challenges.Challenge.query(); });
User.sync(); User.sync();
} else { } else {
$state.go('options.social.challenges.detail', {cid: _challenge._id}); $state.transitionTo('options.social.challenges.detail', {cid: challenge._id}, {
reload: true, inherit: false, notify: true
});
} }
}); });
}; };