From 2e5ca0bb0b7fb11c98ea097e58552ae10c855b3d Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Thu, 5 Dec 2024 17:12:38 -0800 Subject: [PATCH] fix conversation screen refresh --- example/src/hooks.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/src/hooks.tsx b/example/src/hooks.tsx index b032ba2f..6867371d 100644 --- a/example/src/hooks.tsx +++ b/example/src/hooks.tsx @@ -99,7 +99,10 @@ export function useMessages({ const { data: conversation } = useConversation({ topic }) return useQuery( ['xmtp', 'messages', client?.address, conversation?.topic], - () => conversation!.messages(), + async () => { + await conversation!.sync() + return conversation!.messages() + }, { enabled: !!client && !!topic && !!conversation, }