Skip to content

Commit

Permalink
fix: ens resolution not done when creating conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
0xChin committed Oct 3, 2023
1 parent a1adaaa commit 43c034e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions integrations/xmtp/xmtp-start-conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export const XMTPStartConversation = ({ className }: XMTPStartConversation) => {
const handleStartConversation = async () => {
if (peerAddress.trim() !== "") {
if (!canMessage(peerAddress)) return
startConversation(peerAddress, message)
if (peerAddress.endsWith(".eth")) {
startConversation(ensResolvedAddress, message)
} else {
startConversation(peerAddress, message)
}
setPeerAddress("")
setMessage("")
}
Expand Down Expand Up @@ -103,19 +107,19 @@ export const XMTPStartConversation = ({ className }: XMTPStartConversation) => {
<div className={classes}>
<div className="mb-4">
<input
className="w-full input mb-1"
className="input mb-1 w-full"
type="text"
placeholder="Enter an address or ENS..."
value={peerAddress}
onChange={handleAccountChange}
/>
<p className="text-red-500 text-xs italic text-left">
<p className="text-left text-xs italic text-red-500">
{getFeedbackMessage()}
</p>
</div>
<div className={"flex items-center gap-x-4"}>
<input
className="w-full input"
className="input w-full"
type="text"
placeholder="Type your message..."
value={message}
Expand Down

0 comments on commit 43c034e

Please sign in to comment.