Skip to content

Commit

Permalink
fix: fixed group issue
Browse files Browse the repository at this point in the history
mishramonalisha76 committed May 3, 2024
1 parent 971a5ce commit b22bf9d
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ import { IMessagePayload, TwitterFeedReturnType } from '../exportedTypes';
const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => {
const { user } = useContext(ChatDataContext);
const theme = useContext(ThemeContext);
return chat.fromCAIP10 == user?.account ? (
return chat.fromCAIP10 !== user?.account ? (
<Span
theme={theme}
alignSelf="start"
@@ -55,7 +55,7 @@ const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => {
justifyContent="start"
alignItems="start"
>
{chat.fromCAIP10 == user?.account && (
{chat.fromCAIP10 !== user?.account && (
<Section alignItems="start">
{pfp && (
<Image
@@ -83,6 +83,7 @@ const MessageWrapper = ({
isGroup: boolean;
maxWidth?: string;
}) => {
const { user } = useChatData();
const theme = useContext(ThemeContext);
return (
<Section
@@ -93,12 +94,12 @@ const MessageWrapper = ({
width="fit-content"
maxWidth={maxWidth || 'auto'}
>
{isGroup && <SenderMessageProfilePicture chat={chat} />}
{isGroup && chat?.fromCAIP10 !== user?.account && <SenderMessageProfilePicture chat={chat} />}
<Section
justifyContent="start"
flexDirection="column"
>
{isGroup && <SenderMessageAddress chat={chat} />}
{isGroup && chat?.fromCAIP10 !== user?.account && <SenderMessageAddress chat={chat} />}
{children}
</Section>
</Section>
@@ -108,7 +109,6 @@ const MessageWrapper = ({
const MessageCard = ({ chat, position, isGroup }: { chat: IMessagePayload; position: number; isGroup: boolean }) => {
const theme = useContext(ThemeContext);
const time = moment(chat.timestamp).format('hh:mm a');
console.debug(position);
return (
<MessageWrapper
chat={chat}
@@ -322,15 +322,13 @@ export const ChatViewBubble = ({
isGroup?: boolean;
}) => {
const { user } = useChatData();

const position =
pCAIP10ToWallet(decryptedMessagePayload.fromDID).toLowerCase() !== pCAIP10ToWallet(user?.account!)?.toLowerCase()
? 0
: 1;
const { tweetId, messageType }: TwitterFeedReturnType = checkTwitterUrl({
message: decryptedMessagePayload?.messageContent,
});
console.debug(user, position, 'position');
if (messageType === 'TwitterFeedLink') {
decryptedMessagePayload.messageType = 'TwitterFeedLink';
}

0 comments on commit b22bf9d

Please sign in to comment.