From d97608a7104e9f7240e57e021b9e2b24eb08fd8e Mon Sep 17 00:00:00 2001 From: keyan Date: Wed, 18 Aug 2021 18:14:18 -0500 Subject: [PATCH] don't double notify when mentioned in reply to your own content --- api/resolvers/notifications.js | 4 +++- components/notifications.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/resolvers/notifications.js b/api/resolvers/notifications.js index 98ed4003..9d7f2d42 100644 --- a/api/resolvers/notifications.js +++ b/api/resolvers/notifications.js @@ -68,9 +68,11 @@ export default { true as mention FROM "Mention" JOIN "Item" on "Mention"."itemId" = "Item".id + JOIN "Item" p on "Item"."parentId" = p.id WHERE "Mention"."userId" = $1 AND "Mention".created_at <= $2 - AND "Item"."userId" <> $1) + AND "Item"."userId" <> $1 + AND p."userId" <> $1) ORDER BY sort_time DESC OFFSET $3 LIMIT ${LIMIT}`, me.id, decodedCursor.time, decodedCursor.offset) diff --git a/components/notifications.js b/components/notifications.js index 81f77eac..8bf60f15 100644 --- a/components/notifications.js +++ b/components/notifications.js @@ -47,7 +47,7 @@ export default function Notifications ({ variables, ...props }) { you were mentioned in}