mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge pull request #4876 from mfilser/fix_avatar_user_undefined
fix avatar if Meteor.user() is undefined
This commit is contained in:
commit
cfd283e7e3
1 changed files with 8 additions and 4 deletions
|
@ -94,8 +94,12 @@ Meteor.publish('notificationUsers', function() {
|
|||
});
|
||||
|
||||
function activities() {
|
||||
const notifications = Meteor.user().profile.notifications || [];
|
||||
return Activities.find({
|
||||
_id: { $in: notifications.map(v => v.activity) },
|
||||
});
|
||||
const activityIds = Meteor.user()?.profile?.notifications?.map(v => v.activity) || [];
|
||||
let ret = [];
|
||||
if (activityIds.length > 0) {
|
||||
ret = Activities.find({
|
||||
_id: { $in: activityIds },
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue