mirror of
https://github.com/wekan/wekan.git
synced 2026-02-23 08:24:07 +01:00
Fix mentions and notifications drawer.
Thanks to xet7 ! Fixes #6062, fixes #6003, fixes #5996, fixes #5720, fixes #5911, fixes #5792, fixes #5163, fixes #4431, fixes #4126, fixes #3363, fixes #3150
This commit is contained in:
parent
0d5dd3082c
commit
20b5e2ab8f
14 changed files with 225 additions and 72 deletions
|
|
@ -3,10 +3,14 @@ import { ReactiveCache } from '/imports/reactiveCache';
|
|||
Template.notification.events({
|
||||
'click .read-status .materialCheckBox'() {
|
||||
const update = {};
|
||||
update[`profile.notifications.${this.index}.read`] = this.read
|
||||
? null
|
||||
: Date.now();
|
||||
Users.update(Meteor.userId(), { $set: update });
|
||||
const newReadValue = this.read ? null : Date.now();
|
||||
update[`profile.notifications.${this.index}.read`] = newReadValue;
|
||||
|
||||
Users.update(Meteor.userId(), { $set: update }, (error, result) => {
|
||||
if (error) {
|
||||
console.error('Error updating notification:', error);
|
||||
}
|
||||
});
|
||||
},
|
||||
'click .remove a'() {
|
||||
ReactiveCache.getCurrentUser().removeNotification(this.activityData._id);
|
||||
|
|
@ -27,4 +31,16 @@ Template.notification.helpers({
|
|||
const activity = ReactiveCache.getActivity(activityId);
|
||||
return activity && activity.userId;
|
||||
},
|
||||
activityDate() {
|
||||
const activity = this.activityData;
|
||||
if (!activity || !activity.createdAt) return '';
|
||||
|
||||
const user = ReactiveCache.getCurrentUser();
|
||||
if (!user) return '';
|
||||
|
||||
const dateFormat = user.getDateFormat ? user.getDateFormat() : 'L';
|
||||
const timeFormat = user.getTimeFormat ? user.getTimeFormat() : 'LT';
|
||||
|
||||
return moment(activity.createdAt).format(`${dateFormat} ${timeFormat}`);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue