mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Consolidate transition code
This commit is contained in:
@@ -124,15 +124,12 @@ 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.transitionTo('options.social.challenges.detail', {cid: challenge._id}, {
|
|
||||||
reload: true, inherit: false, notify: true
|
|
||||||
});
|
|
||||||
User.sync();
|
User.sync();
|
||||||
} else {
|
|
||||||
$state.transitionTo('options.social.challenges.detail', {cid: challenge._id}, {
|
|
||||||
reload: true, inherit: false, notify: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$state.transitionTo('options.social.challenges.detail', { cid: _challenge._id }, {
|
||||||
|
reload: true, inherit: false, notify: true
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user