Skip to content

Commit

Permalink
fix: fixed group issue (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 authored May 3, 2024
1 parent 3655f6e commit 2f67e3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ChatViewComponentTest = () => {
{/* <CreateGroupModal onClose={()=>{console.log('in close')}} modalBackground={MODAL_BACKGROUND_TYPE.OVERLAY} modalPositionType={MODAL_POSITION_TYPE.RELATIVE}/> */}
<ChatView
onVerificationFail={() => console.log('Verification Failed')}
chatId="4ac5ab85c9c3d57adbdf2dba79357e56b2f9ef0256befe750d9f93af78d2ca68"
chatId="34c44214589cecc176a136ee1daf0f0231ecc6d6574b920b5ae39eb971fa3cb4"
chatProfileLeftHelperComponent={
<img src={Img} onClick={() => console.debug('clicked')} />
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,9 @@ export const ChatViewList: React.FC<IChatViewListProps> = (options: IChatViewLis
invalidChat: false,
});

const [loading, setLoading] = useState<boolean>(true);

const { chatId, limit = chatLimit, chatFilterList = [] } = options || {};
const { user, toast } = useChatData();
const [chatInfo, setChatInfo] = useState<ChatInfoResponse | null>(null);
const [groupInfo, setGroupInfo] = useState<Group | null>(null);
const [userInfo, setUserInfo] = useState<IUser | null>(null);

// const [chatStatusText, setChatStatusText] = useState<string>('');
const [messages, setMessages] = useState<IMessageIPFSWithCID[]>([]);
Expand Down Expand Up @@ -172,9 +168,9 @@ export const ChatViewList: React.FC<IChatViewListProps> = (options: IChatViewLis
//moniters stream changes
useEffect(() => {
if (Object.keys(chatAcceptStream || {}).length > 0 && chatAcceptStream.constructor === Object) {
const updatedChatInfo = { ...(chatInfo as ChatInfoResponse) };
const updatedChatInfo = { ...(initialized.chatInfo as ChatInfoResponse) };
if (updatedChatInfo) updatedChatInfo.list = 'CHATS';
setChatInfo(updatedChatInfo);
setInitialized({ ...initialized, chatInfo: updatedChatInfo });
}
}, [chatAcceptStream]);

Expand Down Expand Up @@ -408,7 +404,7 @@ export const ChatViewList: React.FC<IChatViewListProps> = (options: IChatViewLis
<ChatViewBubble
decryptedMessagePayload={chat}
key={index}
isGroup={chatInfo?.meta?.group ?? false}
isGroup={initialized.chatInfo?.meta?.group ?? false}
/>
</Section>
</>
Expand Down

0 comments on commit 2f67e3c

Please sign in to comment.