From 906cfc29c88a428d07a573555f37bdc947750da9 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 18 Jul 2022 07:59:21 -0600 Subject: [PATCH] Endswith=>includes to handle sort query in group chat --- functions/src/create-notification.ts | 1 + web/components/nav/sidebar.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/src/create-notification.ts b/functions/src/create-notification.ts index 4c42b00e..56493043 100644 --- a/functions/src/create-notification.ts +++ b/functions/src/create-notification.ts @@ -411,6 +411,7 @@ export const createGroupCommentNotification = async ( group: Group, idempotencyKey: string ) => { + if (toUserId === fromUser.id) return const notificationRef = firestore .collection(`/users/${toUserId}/notifications`) .doc(idempotencyKey) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 5c3b9128..821d1397 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -294,7 +294,7 @@ function GroupsList(props: { if ( notification.isSeenOnHref === currentPage || // 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 (notification.isSeenOnHref?.endsWith(GROUP_CHAT_SLUG) && currentPage.endsWith(currentPageGroupSlug))