diff --git a/example/src/HomeScreen.tsx b/example/src/HomeScreen.tsx index 656b40c78..4f69d16d0 100644 --- a/example/src/HomeScreen.tsx +++ b/example/src/HomeScreen.tsx @@ -14,6 +14,7 @@ import { Client, useXmtp, DecodedMessage, + addedByAddress, } from 'xmtp-react-native-sdk' import { Group } from 'xmtp-react-native-sdk/lib/Group' @@ -99,12 +100,24 @@ function GroupListItem({ const [messages, setMessages] = useState< DecodedMessage[] >([]) + const [getAddByAddressState, setAddByAddressState] = useState< + string | undefined + >() useEffect(() => { group ?.sync() .then(() => group.messages()) .then(setMessages) + .then(() => group.addedByAddress()) + .then((result) => client?.contacts.isDenied(result)) + .then((result) => { + if (result) { + setAddByAddressState('The user that added you is blocked') + } else { + setAddByAddressState('') + } + }) .catch((e) => { console.error('Error fetching group messages: ', e) }) @@ -133,6 +146,9 @@ function GroupListItem({ Fallback text + + {getAddByAddressState} + {/* {lastMessage?.senderAddress}: {moment(lastMessage?.sent).fromNow()}