mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
notifications: fix typos and add extra check
This commit is contained in:
@@ -502,7 +502,7 @@ api.seenChat = {
|
|||||||
|
|
||||||
// Remove from response
|
// Remove from response
|
||||||
user.notifications = user.notifications.filter(n => {
|
user.notifications = user.notifications.filter(n => {
|
||||||
if (n && n.type === 'NEW_CHAT_MESSAGE' && n.data.group.id === groupId) {
|
if (n && n.type === 'NEW_CHAT_MESSAGE' && n.data && n.data.group && n.data.group.id === groupId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -703,7 +703,7 @@ function _removeMessagesFromMember (member, groupId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
member.notifications = member.notifications.filter(n => {
|
member.notifications = member.notifications.filter(n => {
|
||||||
if (n && n.type === 'NEW_CHAT_MESSAGE' && n.date && n.data.group && n.data.group.id === groupId) {
|
if (n && n.type === 'NEW_CHAT_MESSAGE' && n.data && n.data.group && n.data.group.id === groupId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user