mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Display first login incentive reward when bailey is dismissed (#8234)
This commit is contained in:
committed by
Sabe Jones
parent
a56b2d68fb
commit
ac732b2c85
@@ -201,8 +201,27 @@ habitrpg.controller('NotificationCtrl',
|
|||||||
Notification.text(error);
|
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
|
// Show new-stuff modal on load
|
||||||
if (User.user.flags.newStuff)
|
if (User.user.flags.newStuff) {
|
||||||
$rootScope.openModal('newStuff', {size:'lg'});
|
var modalScope = $rootScope.$new();
|
||||||
|
modalScope.showLoginIncentive = showLoginIncentive;
|
||||||
|
|
||||||
|
$rootScope.openModal('newStuff', {
|
||||||
|
size:'lg',
|
||||||
|
scope: modalScope,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ script(type='text/ng-template', id='modals/newStuff.html')
|
|||||||
div(ng-bind-html='latestBaileyMessage')
|
div(ng-bind-html='latestBaileyMessage')
|
||||||
.modal-footer
|
.modal-footer
|
||||||
button.btn.btn-default(ng-click='$close()')=env.t('cool')
|
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')
|
||||||
|
|||||||
Reference in New Issue
Block a user