diff --git a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewList.tsx b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewList.tsx index 6c4cb9569..4eea73143 100644 --- a/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewList.tsx +++ b/packages/examples/sdk-frontend-react/src/app/ChatUITest/ChatPreviewList.tsx @@ -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' /> diff --git a/packages/uiweb/src/lib/components/chat/ChatPreviewList/ChatPreviewList.tsx b/packages/uiweb/src/lib/components/chat/ChatPreviewList/ChatPreviewList.tsx index 33cfed824..1833e4eb3 100644 --- a/packages/uiweb/src/lib/components/chat/ChatPreviewList/ChatPreviewList.tsx +++ b/packages/uiweb/src/lib/components/chat/ChatPreviewList/ChatPreviewList.tsx @@ -151,7 +151,22 @@ export const ChatPreviewList: React.FC = ( }); }; - //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) => { @@ -575,10 +590,10 @@ export const ChatPreviewList: React.FC = ( groupCreateStream.constructor === Object ) { if (options.listType === CONSTANTS.CHAT.LIST_TYPE.CHATS) { - // transformStreamMessage(groupCreateStream); + transformGroupCreationStream(groupCreateStream); } } - }, [chatStream]); + }, [groupCreateStream]); useEffect(() => { if ( diff --git a/packages/uiweb/src/lib/hooks/chat/usePushChatStream.ts b/packages/uiweb/src/lib/hooks/chat/usePushChatStream.ts index c76a137bb..51dff22f4 100644 --- a/packages/uiweb/src/lib/hooks/chat/usePushChatStream.ts +++ b/packages/uiweb/src/lib/hooks/chat/usePushChatStream.ts @@ -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); }