Skip to content

Commit b22bf9d

Browse files
fix: fixed group issue
1 parent 971a5ce commit b22bf9d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/uiweb/src/lib/components/chat/ChatViewBubble/ChatViewBubble.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes';
1919
const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => {
2020
const { user } = useContext(ChatDataContext);
2121
const theme = useContext(ThemeContext);
22-
return chat.fromCAIP10 == user?.account ? (
22+
return chat.fromCAIP10 !== user?.account ? (
2323
<Span
2424
theme={theme}
2525
alignSelf="start"
@@ -55,7 +55,7 @@ const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => {
5555
justifyContent="start"
5656
alignItems="start"
5757
>
58-
{chat.fromCAIP10 == user?.account && (
58+
{chat.fromCAIP10 !== user?.account && (
5959
<Section alignItems="start">
6060
{pfp && (
6161
<Image
@@ -83,6 +83,7 @@ const MessageWrapper = ({
8383
isGroup: boolean;
8484
maxWidth?: string;
8585
}) => {
86+
const { user } = useChatData();
8687
const theme = useContext(ThemeContext);
8788
return (
8889
<Section
@@ -93,12 +94,12 @@ const MessageWrapper = ({
9394
width="fit-content"
9495
maxWidth={maxWidth || 'auto'}
9596
>
96-
{isGroup && <SenderMessageProfilePicture chat={chat} />}
97+
{isGroup && chat?.fromCAIP10 !== user?.account && <SenderMessageProfilePicture chat={chat} />}
9798
<Section
9899
justifyContent="start"
99100
flexDirection="column"
100101
>
101-
{isGroup && <SenderMessageAddress chat={chat} />}
102+
{isGroup && chat?.fromCAIP10 !== user?.account && <SenderMessageAddress chat={chat} />}
102103
{children}
103104
</Section>
104105
</Section>
@@ -108,7 +109,6 @@ const MessageWrapper = ({
108109
const MessageCard = ({ chat, position, isGroup }: { chat: IMessagePayload; position: number; isGroup: boolean }) => {
109110
const theme = useContext(ThemeContext);
110111
const time = moment(chat.timestamp).format('hh:mm a');
111-
console.debug(position);
112112
return (
113113
<MessageWrapper
114114
chat={chat}
@@ -322,15 +322,13 @@ export const ChatViewBubble = ({
322322
isGroup?: boolean;
323323
}) => {
324324
const { user } = useChatData();
325-
326325
const position =
327326
pCAIP10ToWallet(decryptedMessagePayload.fromDID).toLowerCase() !== pCAIP10ToWallet(user?.account!)?.toLowerCase()
328327
? 0
329328
: 1;
330329
const { tweetId, messageType }: TwitterFeedReturnType = checkTwitterUrl({
331330
message: decryptedMessagePayload?.messageContent,
332331
});
333-
console.debug(user, position, 'position');
334332
if (messageType === 'TwitterFeedLink') {
335333
decryptedMessagePayload.messageType = 'TwitterFeedLink';
336334
}

0 commit comments

Comments
 (0)