notify on any descendant replies

This commit is contained in:
keyan 2022-01-30 09:35:57 -06:00
parent d0d2d4d1e3
commit e97951dd18
3 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ export default {
(SELECT "Item".id::TEXT, "Item".created_at AS "sortTime", NULL as "earnedSats",
'Reply' AS type
FROM "Item"
JOIN "Item" p ON "Item"."parentId" = p.id
JOIN "Item" p ON "Item".path <@ p.path
WHERE p."userId" = $1
AND "Item"."userId" <> $1 AND "Item".created_at <= $2
ORDER BY "Item".created_at DESC

View File

@ -175,7 +175,7 @@ export default {
const newReplies = await models.$queryRaw(`
SELECT "Item".id, "Item".created_at
FROM "Item"
JOIN "Item" p ON "Item"."parentId" = p.id
JOIN "Item" p ON "Item".path <@ p.path
WHERE p."userId" = $1
AND ("Item".created_at > $2 OR $2 IS NULL) AND "Item"."userId" <> $1
LIMIT 1`, user.id, user.checkedNotesAt)

View File

@ -63,7 +63,7 @@ function Notification ({ n }) {
? <Item item={n.item} />
: (
<div className='pb-2'>
<Comment item={n.item} noReply includeParent rootText={n.__typename === 'Reply' ? 'replying to you on:' : undefined} clickToContext />
<Comment item={n.item} noReply includeParent rootText={n.__typename === 'Reply' ? 'replying on:' : undefined} clickToContext />
</div>)}
</div>
</>)}