-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes ui representation for domain resolution #1336
Changes from 5 commits
66647f0
d3830aa
72eac53
0f4d069
6b50b6f
de7bded
dc6951f
067b0ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,7 @@ export const ChatProfile: React.FC<IChatProfile> = ({ | |
profile.abbrRecipient = getAbbreiatedRecipient(recipient); | ||
profile.desc = profileInfo.profile?.desc; | ||
profile.isGroup = false; | ||
profile.web3Name = chatId.includes('.') ? chatId : null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mishramonalisha76 I meant using the function everywhere so we don't have to use .includes everywhere and keep this logic in a single function. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. understood There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rohitmalhotra1420 this logic is only in two places , most of the places we have to check if chatID.includes('.') then it doesnot something or something else. Should we just make a function to check if a string includes another substring? |
||
} else { | ||
throw new Error( | ||
'UIWeb::ChatProfile::user.profile.info fetch error, possible push user does not exist.' | ||
|
@@ -180,13 +181,14 @@ export const ChatProfile: React.FC<IChatProfile> = ({ | |
profile.icon = null; | ||
profile.chatId = derivedChatId; | ||
profile.recipient = recipient; | ||
profile.web3Name = chatId.includes('.') ? chatId : null; | ||
profile.abbrRecipient = getAbbreiatedRecipient(recipient); | ||
profile.desc = ''; | ||
profile.isGroup = false; | ||
} | ||
|
||
// get and set web3 name asynchrounously | ||
if (profile.recipient) { | ||
if (profile.recipient && !profile.web3Name) { | ||
setupWeb3Name(profile.recipient); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put formattedChatId.includes('.') this in a utility function. Something like
const getChatId=(id:string)=> id.includes(".")? id : null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohitmalhotra1420 added the change