v3 client: correctly redirect after inviting

This commit is contained in:
Matteo Pagliazzi
2016-05-18 17:41:42 +02:00
parent 163b5b4ac3
commit 58b9a08539

View File

@@ -48,7 +48,14 @@ 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();
$rootScope.hardRedirect('/#/options/groups/party'); var redirectTo = '/#/options/groups/'
if ($scope.group.type === 'party') {
redirectTo += 'party';
} else {
redirectTo += ('guilds/' + $scope.group._id);
}
$rootScope.hardRedirect(redirectTo);
}, function(){ }, function(){
_resetInvitees(); _resetInvitees();
}); });