Endswith=>includes to handle sort query in group chat

This commit is contained in:
Ian Philips 2022-07-18 07:59:21 -06:00
parent a247e6d0de
commit 906cfc29c8
2 changed files with 2 additions and 1 deletions

View File

@ -411,6 +411,7 @@ export const createGroupCommentNotification = async (
group: Group, group: Group,
idempotencyKey: string idempotencyKey: string
) => { ) => {
if (toUserId === fromUser.id) return
const notificationRef = firestore const notificationRef = firestore
.collection(`/users/${toUserId}/notifications`) .collection(`/users/${toUserId}/notifications`)
.doc(idempotencyKey) .doc(idempotencyKey)

View File

@ -294,7 +294,7 @@ function GroupsList(props: {
if ( if (
notification.isSeenOnHref === currentPage || notification.isSeenOnHref === currentPage ||
// Old chat style group chat notif ended just with the group slug // Old chat style group chat notif ended just with the group slug
notification.isSeenOnHref?.endsWith(currentPageGroupSlug) || notification.isSeenOnHref?.includes(currentPageGroupSlug) ||
// They're on the home page, so if they've a chat notif, they're seeing the chat // They're on the home page, so if they've a chat notif, they're seeing the chat
(notification.isSeenOnHref?.endsWith(GROUP_CHAT_SLUG) && (notification.isSeenOnHref?.endsWith(GROUP_CHAT_SLUG) &&
currentPage.endsWith(currentPageGroupSlug)) currentPage.endsWith(currentPageGroupSlug))