From 681848917b4184ddbe1b152ced2785a201375f32 Mon Sep 17 00:00:00 2001 From: Monalisha Mishra Date: Thu, 14 Sep 2023 19:59:34 +0530 Subject: [PATCH] fix: fixed message fetching --- .../src/lib/components/chat/ChatViewList/ChatViewList.tsx | 6 ++++-- .../src/lib/components/chat/ConnectButton/ConnectButton.tsx | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx index e721af66d..a7011cd74 100644 --- a/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatViewList/ChatViewList.tsx @@ -96,7 +96,10 @@ export const ChatViewList: React.FC = ( (async () => { if (!account && !env) return; const chat = await fetchChat({ chatId }); - if (Object.keys(chat || {}).length) setChatFeed(chat as IFeeds); + if (Object.keys(chat || {}).length) { + setConversationHash(chat?.threadhash as string); + setChatFeed(chat as IFeeds); + } else { let newChatFeed; let group; @@ -126,7 +129,6 @@ export const ChatViewList: React.FC = ( setLoading(false); })(); }, [chatId, pgpPrivateKey, account, env]); - //moniters socket changes useEffect(() => { if (checkIfSameChat(messagesSinceLastConnection, account!, chatId)) { diff --git a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx index 31a1881f5..a67c40b4d 100644 --- a/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx +++ b/packages/uiweb/src/lib/components/chat/ConnectButton/ConnectButton.tsx @@ -34,14 +34,12 @@ export const ConnectButtonSub = () => { const theme = useContext(ThemeContext); const newFunc = () => { - console.log("wallet getting called") if (wallet) { (async () => { - console.log("Not sure what's happening lol") + const ethersProvider = new ethers.providers.Web3Provider(wallet.provider, 'any') const signer = ethersProvider.getSigner() const newAdd = await getAddressFromSigner(signer) - console.log(newAdd, "newAdd") setSigner(signer) setAccount(newAdd); })()