mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
feat(modals): Won Challenge
Draft of the modal that appears when a user wins a challenge. Needs better logic for when to display.
This commit is contained in:
@@ -27,6 +27,13 @@ habitrpg.controller('NotificationCtrl',
|
||||
$rootScope.playSound('Achievement_Unlocked');
|
||||
}, true);
|
||||
|
||||
$rootScope.$watch('user.achievements.challenges.length', function(after, before) {
|
||||
if (after === before) return;
|
||||
if (after > before) {
|
||||
$rootScope.openModal('wonChallenge', {controller: 'UserCtrl', size: 'sm'});
|
||||
}
|
||||
});
|
||||
|
||||
$rootScope.$watch('user.stats.gp', function(after, before) {
|
||||
if (after == before) return;
|
||||
if (User.user.stats.lvl == 0) return;
|
||||
|
||||
Reference in New Issue
Block a user