mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Api v3 party quest fixes (#7341)
* Fix display of add challenge message when group challenges are empty * Fixed forced quest start to update quest without reload * Fixed needing to reload when accepting party invite * Fix group leave and join reload * Fixed leave current party and join another * Updated party tests
This commit is contained in:
committed by
Matteo Pagliazzi
parent
7ac67315e6
commit
1a87619bac
@@ -57,12 +57,15 @@ habitrpg.controller("GuildsCtrl", ['$scope', 'Groups', 'User', 'Challenges', '$r
|
||||
.then(function (response) {
|
||||
var joinedGroup = response.data.data;
|
||||
|
||||
User.user.guilds.push(joinedGroup._id);
|
||||
|
||||
if (joinedGroup.privacy == 'public') {
|
||||
Analytics.track({'hitType':'event', 'eventCategory':'behavior', 'eventAction':'join group', 'owner':false, 'groupType':'guild','privacy': joinedGroup.privacy, 'groupName': joinedGroup.name})
|
||||
} else {
|
||||
Analytics.track({'hitType':'event', 'eventCategory':'behavior', 'eventAction':'join group', 'owner':false, 'groupType':'guild','privacy': joinedGroup.privacy})
|
||||
}
|
||||
$rootScope.hardRedirect('/#/options/groups/guilds/' + joinedGroup._id);
|
||||
|
||||
$location.path('/options/groups/guilds/' + joinedGroup._id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,7 +80,10 @@ habitrpg.controller("GuildsCtrl", ['$scope', 'Groups', 'User', 'Challenges', '$r
|
||||
} else {
|
||||
Groups.Group.leave($scope.selectedGroup._id, keep)
|
||||
.success(function (data) {
|
||||
$rootScope.hardRedirect('/#/options/groups/guilds');
|
||||
var index = User.user.guilds.indexOf($scope.selectedGroup._id);
|
||||
delete User.user.guilds[index];
|
||||
$scope.selectedGroup = undefined;
|
||||
$location.path('/options/groups/guilds');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user