From 28a2e22b740da7db549c1f1cf447ddd16904ae95 Mon Sep 17 00:00:00 2001 From: ~latter-bolden Date: Wed, 4 Dec 2024 09:37:46 -0600 Subject: [PATCH 1/2] always show self on contact screen --- packages/ui/src/components/ContactsScreenView.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/ui/src/components/ContactsScreenView.tsx b/packages/ui/src/components/ContactsScreenView.tsx index a93ff9aa30..a283e4eeed 100644 --- a/packages/ui/src/components/ContactsScreenView.tsx +++ b/packages/ui/src/components/ContactsScreenView.tsx @@ -40,11 +40,9 @@ export function ContactsScreenView(props: Props) { const sections = useMemo(() => { const result: Section[] = []; - if (userContact) { - result.push({ - data: [userContact], - }); - } + result.push({ + data: [userContact ?? db.getFallbackContact(currentUserId)], + }); if (sortedContacts.length > 0) { result.push({ @@ -60,11 +58,11 @@ export function ContactsScreenView(props: Props) { } return result; - }, [userContact, sortedContacts, trimmedSuggested]); + }, [userContact, currentUserId, sortedContacts, trimmedSuggested]); const renderItem = useCallback( ({ item }: { item: db.Contact }) => { - const isSelf = item.id === userContact?.id; + const isSelf = item.id === currentUserId; return ( Date: Wed, 4 Dec 2024 10:59:25 -0600 Subject: [PATCH 2/2] ding the bell for non-notifying contact events --- packages/shared/src/db/queries.ts | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/shared/src/db/queries.ts b/packages/shared/src/db/queries.ts index 4a7f93516a..bb92971c53 100644 --- a/packages/shared/src/db/queries.ts +++ b/packages/shared/src/db/queries.ts @@ -3180,16 +3180,27 @@ export const getUnreadUnseenActivityEvents = createReadQuery( .where( and( gt($activityEvents.timestamp, seenMarker), - eq($activityEvents.shouldNotify, true), or( - and(eq($activityEvents.type, 'reply'), gt($threadUnreads.count, 0)), - and(eq($activityEvents.type, 'post'), gt($channelUnreads.count, 0)), + eq($activityEvents.type, 'contact'), and( - gt($groupUnreads.notifyCount, 0), + eq($activityEvents.shouldNotify, true), or( - eq($activityEvents.type, 'group-ask'), - eq($activityEvents.type, 'flag-post'), - eq($activityEvents.type, 'flag-reply') + and( + eq($activityEvents.type, 'reply'), + gt($threadUnreads.count, 0) + ), + and( + eq($activityEvents.type, 'post'), + gt($channelUnreads.count, 0) + ), + and( + gt($groupUnreads.notifyCount, 0), + or( + eq($activityEvents.type, 'group-ask'), + eq($activityEvents.type, 'flag-post'), + eq($activityEvents.type, 'flag-reply') + ) + ) ) ) )