mirror of
https://github.com/wekan/wekan.git
synced 2026-01-23 17:56:09 +01:00
Fixed Add member and @mentions.
Thanks to xet7 ! Fixes #6076, fixes #6077
This commit is contained in:
parent
603a65ef17
commit
ad511bd137
14 changed files with 413 additions and 149 deletions
|
|
@ -23,12 +23,15 @@ Notifications = {
|
|||
const users = [];
|
||||
watchers.forEach(userId => {
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
if (user) users.push(user);
|
||||
if (user && user._id) users.push(user);
|
||||
});
|
||||
return users;
|
||||
},
|
||||
|
||||
notify: (user, title, description, params) => {
|
||||
// Skip if user is invalid
|
||||
if (!user || !user._id) return;
|
||||
|
||||
for (const k in notifyServices) {
|
||||
const notifyImpl = notifyServices[k];
|
||||
if (notifyImpl && typeof notifyImpl === 'function')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
Meteor.startup(() => {
|
||||
Notifications.subscribe('profile', (user, title, description, params) => {
|
||||
user.addNotification(params.activityId);
|
||||
try {
|
||||
// Validate user object before processing
|
||||
if (!user || !user._id) {
|
||||
console.error('Invalid user object in notification:', { user, title, params });
|
||||
return;
|
||||
}
|
||||
const modifier = user.addNotification(params.activityId);
|
||||
Users.direct.update(user._id, modifier);
|
||||
} catch (error) {
|
||||
console.error('Error adding notification:', error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue