mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Fixed start party by invites
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
habitrpg.controller('InviteToGroupCtrl', ['$scope', 'User', 'Groups', 'injectedGroup', '$http', 'Notification',
|
||||
function($scope, User, Groups, injectedGroup, $http, Notification) {
|
||||
habitrpg.controller('InviteToGroupCtrl', ['$scope', '$rootScope', 'User', 'Groups', 'injectedGroup', '$http', 'Notification',
|
||||
function($scope, $rootScope, User, Groups, injectedGroup, $http, Notification) {
|
||||
$scope.group = injectedGroup;
|
||||
|
||||
$scope.inviter = User.user.profile.name;
|
||||
@@ -22,6 +22,8 @@ habitrpg.controller('InviteToGroupCtrl', ['$scope', 'User', 'Groups', 'injectedG
|
||||
return Groups.Group.create($scope.group)
|
||||
.then(function(response) {
|
||||
$scope.group = response.data.data;
|
||||
User.sync();
|
||||
Groups.data.party = $scope.group;
|
||||
_inviteByMethod(inviteMethod);
|
||||
});
|
||||
}
|
||||
@@ -46,6 +48,7 @@ habitrpg.controller('InviteToGroupCtrl', ['$scope', 'User', 'Groups', 'injectedG
|
||||
.then(function() {
|
||||
Notification.text(window.env.t('invitationsSent'));
|
||||
_resetInvitees();
|
||||
$rootScope.hardRedirect('/#/options/groups/party');
|
||||
}, function(){
|
||||
_resetInvitees();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user