fix(client): Refresh party page when inviting users

This commit is contained in:
Blade Barringer
2016-06-19 09:41:43 -05:00
parent 851ad59fb8
commit a4dba82d14

View File

@@ -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();
}); });