mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-21 21:28:52 +00:00
Merge pull request #5008 from gisikw/fix-singleton-challenge-edit
Singleton challenge edit -> detail on save -- Fixes #5001
This commit is contained in:
commit
b1e8f16639
1 changed files with 6 additions and 7 deletions
|
|
@ -94,15 +94,14 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
|||
challenge.$save(function(_challenge){
|
||||
if (isNew) {
|
||||
Notification.text(window.env.t('challengeCreated'));
|
||||
$state.go('options.social.challenges.detail', {cid: _challenge._id});
|
||||
$scope.discard();
|
||||
$scope.challenges = Challenges.Challenge.query();
|
||||
$state.transitionTo('options.social.challenges.detail', {cid: challenge._id}, {
|
||||
reload: true, inherit: false, notify: true
|
||||
});
|
||||
User.sync();
|
||||
} else {
|
||||
// TODO figure out a more elegant way about this
|
||||
//challenge._editing = false;
|
||||
challenge._locked = true;
|
||||
getChallenges();
|
||||
$state.transitionTo('options.social.challenges.detail', {cid: challenge._id}, {
|
||||
reload: true, inherit: false, notify: true
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue