mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
fix(notifications): Don't double-modal
Corrects behavior of the Notifications controller so that it skips showing the generic levelup modal if it's going to display the quest scroll version.
This commit is contained in:
@@ -53,6 +53,15 @@ habitrpg.controller('NotificationCtrl',
|
||||
Notification.mp(mana);
|
||||
});
|
||||
|
||||
$rootScope.$watch('user.stats.lvl', function(after, before) {
|
||||
if ((after === before) || (User.user._tmp && User.user._tmp.drop && (User.user._tmp.drop.type === 'Quest'))) return;
|
||||
if (after > before) {
|
||||
Notification.lvl();
|
||||
$rootScope.playSound('Level_Up');
|
||||
$rootScope.openModal('levelUp', {controller:'UserCtrl', size:'sm'});
|
||||
}
|
||||
});
|
||||
|
||||
$rootScope.$watch('user._tmp.crit', function(after, before){
|
||||
if (after == before || !after) return;
|
||||
var amount = User.user._tmp.crit * 100 - 100;
|
||||
@@ -148,15 +157,6 @@ habitrpg.controller('NotificationCtrl',
|
||||
}
|
||||
});
|
||||
|
||||
$rootScope.$watch('user.stats.lvl', function(after, before) {
|
||||
if (after == before) return;
|
||||
if (after > before) {
|
||||
Notification.lvl();
|
||||
$rootScope.playSound('Level_Up');
|
||||
$rootScope.openModal('levelUp', {controller:'UserCtrl', size:'sm'});
|
||||
}
|
||||
});
|
||||
|
||||
// Completed quest modal
|
||||
$scope.$watch('user.party.quest.completed', function(after, before){
|
||||
if (!after) return;
|
||||
|
||||
Reference in New Issue
Block a user