mirror of
https://github.com/PretendoNetwork/juxtaposition-ui.git
synced 2026-08-26 11:15:42 -05:00
Fixed incorrect handling of message unread notifications. Dependency audit fixes
This commit is contained in:
3338
package-lock.json
generated
3338
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -34,18 +34,14 @@ const ConversationSchema = new Schema({
|
||||
users: [user]
|
||||
});
|
||||
|
||||
ConversationSchema.methods.newMessage = async function(message, fromPid) {
|
||||
if(this.users[0].pid === fromPid) {
|
||||
this.users[1].read = false;
|
||||
this.markModified('users[1].read');
|
||||
}
|
||||
else {
|
||||
this.users[0].read = false;
|
||||
this.markModified('users[0].read');
|
||||
}
|
||||
this.set('last_updated', moment(new Date()));
|
||||
this.set('message_preview', message);
|
||||
await this.save();
|
||||
ConversationSchema.methods.newMessage = async function(message, senderPID) {
|
||||
this.last_updated = new Date();
|
||||
this.message_preview = message;
|
||||
const sender = this.users.find(user => user.pid === senderPID);
|
||||
if (sender) {
|
||||
sender.read = false;
|
||||
}
|
||||
await this.save();
|
||||
}
|
||||
|
||||
ConversationSchema.methods.markAsRead = async function(pid) {
|
||||
|
||||
Reference in New Issue
Block a user