From 2e15c447dc7e79545da8248c7de0ae8542cb0c9b Mon Sep 17 00:00:00 2001 From: Ben Kremer Date: Fri, 28 Oct 2022 13:42:18 +0200 Subject: [PATCH] fix: ensure address is registered immediately on first startup --- wallets/react-wallet-chat/src/hooks/useInitialization.ts | 2 ++ wallets/react-wallet-chat/src/pages/chats.tsx | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wallets/react-wallet-chat/src/hooks/useInitialization.ts b/wallets/react-wallet-chat/src/hooks/useInitialization.ts index 5c5ca85..a47a343 100644 --- a/wallets/react-wallet-chat/src/hooks/useInitialization.ts +++ b/wallets/react-wallet-chat/src/hooks/useInitialization.ts @@ -21,6 +21,8 @@ export default function useInitialization() { await createSignClient() await createChatClient() + await chatClient.register({ account: `eip155:1:${eip155Addresses[0]}` }) + console.log('[Chat] registered address %s on keyserver', `eip155:1:${eip155Addresses[0]}`) setInitialized(true) } catch (err: unknown) { diff --git a/wallets/react-wallet-chat/src/pages/chats.tsx b/wallets/react-wallet-chat/src/pages/chats.tsx index 2aa120a..00a2a52 100644 --- a/wallets/react-wallet-chat/src/pages/chats.tsx +++ b/wallets/react-wallet-chat/src/pages/chats.tsx @@ -21,11 +21,8 @@ export default function ChatsPage() { const [chatInvites, setChatInvites] = useState([]) - const { eip155Address } = useSnapshot(SettingsStore.state) - const initChatClient = async () => { console.log(chatClient) - await chatClient.register({ account: `eip155:1:${eip155Address}` }) console.log('chatInvites on load:', chatClient.chatInvites.getAll()) console.log('chatThreads on load:', chatClient.chatThreads.getAll())