mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix(client): Refresh party page when inviting users
This commit is contained in:
@@ -22,8 +22,6 @@ habitrpg.controller('InviteToGroupCtrl', ['$scope', '$rootScope', 'User', 'Group
|
|||||||
return Groups.Group.create($scope.group)
|
return Groups.Group.create($scope.group)
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
$scope.group = response.data.data;
|
$scope.group = response.data.data;
|
||||||
User.sync();
|
|
||||||
Groups.data.party = $scope.group;
|
|
||||||
_inviteByMethod(inviteMethod);
|
_inviteByMethod(inviteMethod);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -48,13 +46,12 @@ habitrpg.controller('InviteToGroupCtrl', ['$scope', '$rootScope', 'User', 'Group
|
|||||||
.then(function() {
|
.then(function() {
|
||||||
Notification.text(window.env.t('invitationsSent'));
|
Notification.text(window.env.t('invitationsSent'));
|
||||||
_resetInvitees();
|
_resetInvitees();
|
||||||
if ($scope.group.type === 'party') {
|
|
||||||
Groups.removePartyCache();
|
|
||||||
$rootScope.$state.go('options.social.party');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$rootScope.hardRedirect('/#/options/groups/guilds/' + $scope.group._id);
|
if ($scope.group.type === 'party') {
|
||||||
|
$rootScope.hardRedirect('/#/options/groups/party');
|
||||||
|
} else {
|
||||||
|
$rootScope.hardRedirect('/#/options/groups/guilds/' + $scope.group._id);
|
||||||
|
}
|
||||||
}, function(){
|
}, function(){
|
||||||
_resetInvitees();
|
_resetInvitees();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user