Make user sync after accepting or rejecting a quest

This commit is contained in:
Blade Barringer
2015-05-28 08:14:50 -05:00
parent dc8647d6ae
commit 42b482cb7e
3 changed files with 21 additions and 3 deletions

View File

@@ -501,6 +501,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
.controller("PartyCtrl", ['$rootScope','$scope', 'Groups', 'User', 'Challenges', '$state', '$compile',
function($rootScope,$scope, Groups, User, Challenges, $state, $compile) {
$scope.type = 'party';
$scope.text = window.env.t('party');
$scope.group = $rootScope.party = Groups.party();
@@ -579,6 +580,23 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
$rootScope.party.$questAbort();
}
$scope.questAccept = function(party){
party.$questAccept()
.then(function(res) {
User.sync();
}, function(err) {
console.log(err);
});
}
$scope.questReject = function(party){
party.$questReject()
.then(function(res) {
User.sync();
}, function(err) {
console.log(err);
});
}
}
])