Skip to content

Commit

Permalink
fix: fixed group fiex
Browse files Browse the repository at this point in the history
  • Loading branch information
mishramonalisha76 committed Mar 22, 2024
1 parent cd90cf2 commit 02773ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const ChatPreviewListTest = () => {
onLoading={(loadingData) => { console.log("loading data: ", loadingData) }}
onPaging={(chats) => { console.log("paging chats are: ", chats) }}
onPreload={(chats) => { console.log("preload chats are: ", chats) }}
prefillChatPreviewList={prefill}
// prefillChatPreviewList={prefill}
// listType='SEARCH'
// searchParamter='0x56A734ba4C7c7b117774C9aAcCEf521eBE66d65b'
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,22 @@ export const ChatPreviewList: React.FC<IChatPreviewListProps> = (
});
};

//Transform
//Transform group creation stream
const transformGroupCreationStream: (item: any) => void = async (item: any) => {
const transformedItem: IChatPreviewPayload = {
chatId:item?.chatId,
chatPic: item?.meta.image,
chatParticipant: item?.meta.name,
chatGroup: true,
chatTimestamp: undefined,
chatMsg: {
messageType: '',
messageContent: '',
}
}
addChatItems([transformedItem]);
}


// Transform stream message
const transformStreamMessage: (item: any) => void = async (item: any) => {
Expand Down Expand Up @@ -575,10 +590,10 @@ export const ChatPreviewList: React.FC<IChatPreviewListProps> = (
groupCreateStream.constructor === Object
) {
if (options.listType === CONSTANTS.CHAT.LIST_TYPE.CHATS) {
// transformStreamMessage(groupCreateStream);
transformGroupCreationStream(groupCreateStream);
}
}
}, [chatStream]);
}, [groupCreateStream]);

useEffect(() => {
if (
Expand Down
1 change: 1 addition & 0 deletions packages/uiweb/src/lib/hooks/chat/usePushChatStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const usePushChatStream = () => {

// Listen for group info
stream?.on(CONSTANTS.STREAM.CHAT_OPS, (chatops: any) => {
console.debug(chatops)
if (chatops.event === 'chat.group.update') {
setGroupUpdateStream(chatops);
}
Expand Down

0 comments on commit 02773ef

Please sign in to comment.