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:
Sabe Jones
2015-10-16 23:36:57 -04:00
parent 338aced208
commit 22ec450521
6 changed files with 40 additions and 2 deletions

View File

@@ -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;