mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
apiv2 handle notifications circular-dependency. migration
fixes. Rest=>Sleep fixes
This commit is contained in:
@@ -5,16 +5,19 @@ habitrpg.controller('NotificationCtrl',
|
||||
|
||||
$rootScope.$watch('user.stats.hp', function(after, before) {
|
||||
if (after == before) return;
|
||||
if (User.user.stats.lvl == 0) return;
|
||||
Notification.hp(after - before, 'hp');
|
||||
});
|
||||
|
||||
$rootScope.$watch('user.stats.exp', function(after, before) {
|
||||
if (after == before) return;
|
||||
if (User.user.stats.lvl == 0) return;
|
||||
Notification.exp(after - before);
|
||||
});
|
||||
|
||||
$rootScope.$watch('user.stats.gp', function(after, before) {
|
||||
if (after == before) return;
|
||||
if (User.user.stats.lvl == 0) return;
|
||||
var money = after - before;
|
||||
Notification.gp(money);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user