Skip to content

Commit

Permalink
Fix weird formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Risch authored and Alex Risch committed Jun 18, 2024
1 parent f270b42 commit e7ca660
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utils/str.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ export const addressPrefix = (address: string) =>
(address && address.length >= 6 ? address.slice(0, 6) : address) || "";

export const conversationName = (conversation: XmtpConversation) => {
const defaultName = conversation.isGroup
? conversation.groupName
? conversation.groupName
: capitalize(humanize(conversation.topic.slice(14, 46), 3, " "))
: shortAddress(conversation.peerAddress);
if (conversation.isGroup) {
return (
conversation.groupName ||
capitalize(humanize(conversation.topic.slice(14, 46), 3, " "))
);
}
const defaultName = shortAddress(conversation.peerAddress);
return conversation.conversationTitle || defaultName;
};

Expand Down

0 comments on commit e7ca660

Please sign in to comment.