mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
Make attribute referencing in notification logic more robust
This commit is contained in:
parent
9ecbe9d48f
commit
5809e52fe9
1 changed files with 2 additions and 2 deletions
|
|
@ -97,9 +97,9 @@ angular.module('authCtrl', [])
|
|||
|
||||
function selectNotificationValue(mysteryValue, invitationValue, unallocatedValue, messageValue, noneValue) {
|
||||
var user = $scope.user;
|
||||
if (user.purchased.plan.mysteryItems.length) {
|
||||
if (user.purchased && user.purchased.plan && user.purchased.plan.mysteryItems && user.purchased.plan.mysteryItems.length) {
|
||||
return mysteryValue;
|
||||
} else if ((user.invitations.party && user.invitations.party.id) || user.invitations.guilds.length > 0) {
|
||||
} else if ((user.invitations.party && user.invitations.party.id) || (user.invitations.guilds && user.invitations.guilds.length > 0)) {
|
||||
return invitationValue;
|
||||
} else if (user.flags.classSelected && !(user.preferences && user.preferences.disableClasses) && user.stats.points) {
|
||||
return unallocatedValue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue