Skip to content

Commit

Permalink
Merge pull request #4247 from tloncorp/lb/contact-fixes-omni
Browse files Browse the repository at this point in the history
native: couple small contact fixes
  • Loading branch information
latter-bolden authored Dec 4, 2024
2 parents 630c907 + d63a971 commit 63eef46
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
25 changes: 18 additions & 7 deletions packages/shared/src/db/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3196,16 +3196,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')
)
)
)
)
)
Expand Down
12 changes: 5 additions & 7 deletions packages/ui/src/components/ContactsScreenView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,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({
Expand All @@ -54,11 +52,11 @@ export function ContactsScreenView(props: Props) {
}

return result;
}, [userContact, sortedContacts, props.suggestions]);
}, [userContact, currentUserId, sortedContacts, props.suggestions]);

const renderItem = useCallback(
({ item }: { item: db.Contact }) => {
const isSelf = item.id === userContact?.id;
const isSelf = item.id === currentUserId;
return (
<ContactListItem
size="$4xl"
Expand Down

0 comments on commit 63eef46

Please sign in to comment.