mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Fixing Duplicate tasks showing up after joining a challenge (#7787)
* fix: prevents double joining challenge by quickly hitting join button on challenge twice. fixes #7730 * Fixing client side parameter updates.
This commit is contained in:
@@ -320,6 +320,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
||||
*/
|
||||
|
||||
$scope.join = function (challenge) {
|
||||
challenge._joiningInProgress = true;
|
||||
Challenges.joinChallenge(challenge._id)
|
||||
.then(function (response) {
|
||||
User.user.challenges.push(challenge._id);
|
||||
@@ -329,6 +330,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
||||
.then(function (response) {
|
||||
var tasks = response.data.data;
|
||||
User.syncUserTasks(tasks);
|
||||
challenge._joiningInProgress = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user