Fixed quest drop modal (#7377)

* Fixed quest drop modal

* Fixed broken party test
This commit is contained in:
Keith Holliday
2016-05-21 11:21:39 +01:00
committed by Matteo Pagliazzi
parent d36c514c06
commit f4ca97ffc3
4 changed files with 23 additions and 13 deletions

View File

@@ -11,15 +11,13 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
$scope.inviteOrStartParty = Groups.inviteOrStartParty;
$scope.loadWidgets = Social.loadWidgets;
if ($state.is('options.social.party')) {
Groups.Group.syncParty()
.then(function successCallback(group) {
$rootScope.party = $scope.group = group;
checkForNotifications();
}, function errorCallback(response) {
$rootScope.party = $scope.group = $scope.newGroup = { type: 'party' };
});
}
Groups.Group.syncParty()
.then(function successCallback(group) {
$rootScope.party = $scope.group = group;
checkForNotifications();
}, function errorCallback(response) {
$rootScope.party = $scope.group = $scope.newGroup = { type: 'party' };
});
function checkForNotifications () {
// Checks if user's party has reached 2 players for the first time.
@@ -148,6 +146,15 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
User.set({'invitations.party':{}});
}
$scope.questInit = function() {
var key = $rootScope.selectedQuest.key;
Quests.initQuest(key).then(function() {
$rootScope.selectedQuest = undefined;
$scope.$close();
});
};
$scope.questCancel = function(){
if (!confirm(window.env.t('sureCancel'))) return;