mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
[#1670] don't refresh on challenge create/join/leave (meh, workaround)
This commit is contained in:
@@ -67,7 +67,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
if (isNew) {
|
if (isNew) {
|
||||||
Notification.text('Challenge Created');
|
Notification.text('Challenge Created');
|
||||||
$scope.discard();
|
$scope.discard();
|
||||||
$scope.challenges.unshift(_challenge);
|
$scope.challenges = Challenges.Challenge.query();
|
||||||
} else {
|
} else {
|
||||||
// TODO figure out a more elegant way about this
|
// TODO figure out a more elegant way about this
|
||||||
//challenge._editing = false;
|
//challenge._editing = false;
|
||||||
@@ -158,6 +158,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
|
|
||||||
$scope.join = function(challenge){
|
$scope.join = function(challenge){
|
||||||
challenge.$join(function(){
|
challenge.$join(function(){
|
||||||
|
$scope.challenges = Challenges.Challenge.query();
|
||||||
User.log({});
|
User.log({});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -168,6 +169,7 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
|||||||
$scope.selectedChal = undefined;
|
$scope.selectedChal = undefined;
|
||||||
} else {
|
} else {
|
||||||
$scope.selectedChal.$leave({keep:keep}, function(){
|
$scope.selectedChal.$leave({keep:keep}, function(){
|
||||||
|
$scope.challenges = Challenges.Challenge.query();
|
||||||
User.log({});
|
User.log({});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user