diff --git a/src/lib/hooks/useNotificationHandler.ts b/src/lib/hooks/useNotificationHandler.ts index 12e15057..3240a485 100644 --- a/src/lib/hooks/useNotificationHandler.ts +++ b/src/lib/hooks/useNotificationHandler.ts @@ -58,7 +58,7 @@ export function useNotificationsHandler() { const closeAllActiveElements = useCloseAllActiveElements() // Safety to prevent double handling of the same notification - const prevIdentifier = React.useRef('') + const prevDate = React.useRef(0) React.useEffect(() => { const handleNotification = (payload?: NotificationPayload) => { @@ -161,10 +161,10 @@ export function useNotificationsHandler() { const responseReceivedListener = Notifications.addNotificationResponseReceivedListener(e => { - if (e.notification.request.identifier === prevIdentifier.current) { + if (e.notification.date === prevDate.current) { return } - prevIdentifier.current = e.notification.request.identifier + prevDate.current = e.notification.date logger.debug( 'Notifications: response received', diff --git a/src/screens/Messages/Conversation/index.tsx b/src/screens/Messages/Conversation/index.tsx index 4c8cfe7e..686a0f5d 100644 --- a/src/screens/Messages/Conversation/index.tsx +++ b/src/screens/Messages/Conversation/index.tsx @@ -160,7 +160,7 @@ let Header = ({ a.gap_lg, a.pl_xl, a.pr_lg, - a.py_sm, + a.py_md, ]}> {!gtTablet ? ( {profile.displayName} - + @{profile.handle} diff --git a/src/screens/Messages/List/index.tsx b/src/screens/Messages/List/index.tsx index 6c07073a..55d65a88 100644 --- a/src/screens/Messages/List/index.tsx +++ b/src/screens/Messages/List/index.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/prop-types */ - import React, {useCallback, useMemo, useState} from 'react' import {View} from 'react-native' import {ChatBskyConvoDefs} from '@atproto-labs/api' @@ -40,6 +38,21 @@ import {ClipClopGate} from '../gate' import {useDmServiceUrlStorage} from '../Temp/useDmServiceUrlStorage' type Props = NativeStackScreenProps + +function renderItem({ + item, + index, +}: { + item: ChatBskyConvoDefs.ConvoView + index: number +}) { + return +} + +function keyExtractor(item: ChatBskyConvoDefs.ConvoView) { + return item.id +} + export function MessagesScreen({navigation, route}: Props) { const {_} = useLingui() const t = useTheme() @@ -135,13 +148,6 @@ export function MessagesScreen({navigation, route}: Props) { navigation.navigate('MessagesSettings') }, [navigation]) - const renderItem = useCallback( - ({item}: {item: ChatBskyConvoDefs.ConvoView}) => { - return - }, - [], - ) - const gate = useGate() if (!gate('dms')) return @@ -213,7 +219,7 @@ export function MessagesScreen({navigation, route}: Props) { )} @@ -221,7 +227,7 @@ export function MessagesScreen({navigation, route}: Props) { item.id} + keyExtractor={keyExtractor} refreshing={isPTRing} onRefresh={onRefresh} onEndReached={onEndReached} @@ -249,7 +255,13 @@ export function MessagesScreen({navigation, route}: Props) { ) } -function ChatListItem({convo}: {convo: ChatBskyConvoDefs.ConvoView}) { +function ChatListItem({ + convo, + index, +}: { + convo: ChatBskyConvoDefs.ConvoView + index: number +}) { const t = useTheme() const {_} = useLingui() const {currentAccount} = useSession() @@ -301,95 +313,120 @@ function ChatListItem({convo}: {convo: ChatBskyConvoDefs.ConvoView}) { } return ( - + )} + + ) } @@ -412,8 +449,6 @@ function DesktopHeader({