Skip to content

Commit

Permalink
feat: add real-time messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
0xChin committed Oct 5, 2023
1 parent 2f2b558 commit 0508b4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion integrations/xmtp/xmtp-chat.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"use client"

import * as React from "react"
import { useClient, useConversations } from "@xmtp/react-sdk"
import {
useClient,
useConversations,
useStreamAllMessages,
} from "@xmtp/react-sdk"

import { cn } from "@/lib/utils"

Expand All @@ -16,6 +20,10 @@ export const XMTPChat = ({ className }: XMTPChat) => {
const { client } = useClient()

const { conversations } = useConversations()
useStreamAllMessages(
() => {},
() => {}
)

if (!client)
return (
Expand Down
2 changes: 1 addition & 1 deletion integrations/xmtp/xmtp-start-conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const XMTPStartConversation = ({ className }: XMTPStartConversation) => {
typeof ensResolvedAddress === "string" &&
isValidAddress(ensResolvedAddress)
) {
checkEnsAddress(ensResolvedAddress).catch((err) => console.log(err))
void checkEnsAddress(ensResolvedAddress)
}
}, [ensResolvedAddress])

Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/use-ens-address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function useEnsAddress(name: string) {
}

if (name.endsWith(".eth")) {
updateAddress().catch((err) => console.log(err))
void updateAddress()
}
}, [name])

Expand Down

0 comments on commit 0508b4d

Please sign in to comment.