Display first login incentive reward when bailey is dismissed (#8234)

This commit is contained in:
Keith Holliday
2016-11-23 21:44:11 -06:00
committed by Sabe Jones
parent a56b2d68fb
commit ac732b2c85
2 changed files with 22 additions and 3 deletions

View File

@@ -201,8 +201,27 @@ habitrpg.controller('NotificationCtrl',
Notification.text(error);
});
function showLoginIncentive() {
var rewardData = {
reward: [Shared.content.quests.dustbunnies],
rewardKey: ['inventory_quest_scroll_dustbunnies'],
rewardText: Shared.content.quests.dustbunnies.text(),
message: window.env.t('checkinEarned'),
nextRewardAt: 1,
};
Notification.showLoginIncentive(User.user, rewardData, Social.loadWidgets);
}
// Show new-stuff modal on load
if (User.user.flags.newStuff)
$rootScope.openModal('newStuff', {size:'lg'});
if (User.user.flags.newStuff) {
var modalScope = $rootScope.$new();
modalScope.showLoginIncentive = showLoginIncentive;
$rootScope.openModal('newStuff', {
size:'lg',
scope: modalScope,
});
}
}
]);

View File

@@ -9,4 +9,4 @@ script(type='text/ng-template', id='modals/newStuff.html')
div(ng-bind-html='latestBaileyMessage')
.modal-footer
button.btn.btn-default(ng-click='$close()')=env.t('cool')
button.btn.btn-warning(ng-click='dismissAlert(); $close()')=env.t('dismissAlert')
button.btn.btn-warning(ng-click='dismissAlert(); $close(); showLoginIncentive()')=env.t('dismissAlert')