cometchat / cometchat-uikit-react

Ready-to-use Chat UI Components for React (JavaScript/Web)
Other
92 stars 58 forks source link

When I use CometChatConversations component, it only updates the inbox if I forcefully refresh the UI #147

Closed jeliel-augusto20 closed 1 month ago

jeliel-augusto20 commented 1 month ago

Describe the problem

When I use CometChatConversations component, it only updates the inbox if I forcefully refresh the UI

What was the expected behavior?

CometChatConversations should update UI as soon as someone send as messages

Reproduction

Detail the steps taken to reproduce this error, and whether this issue can be reproduced consistently or if it is intermittent. Note: If clear, reproducable steps or the smallest sample app demonstrating misbehavior cannot be provided, we may not be able to follow up on this bug report.

Where applicable, please include:

  • The smallest possible sample app that reproduces the undesirable behavior
  • Log files (redact/remove sensitive information)
  • Application settings (redact/remove sensitive information)
  • Screenshots

https://github.com/user-attachments/assets/bebf8f79-f21c-4ace-bf19-6d1ad22976f8

Environment

Please provide the following:

Code


interface InboxWrapperProps {
conversations?: CometChat.ConversationsRequestBuilder;
onChatOperation?: (operation: ConversationActions, conversation: Conversation) => void;
onItemClick: (conversation: CometChat.Conversation) => void;
onNewMessage: () => void;
onSearch: (search: string) => void;
supportMode?: boolean;
onNewBroadcast: () => void;
}
export const InboxWrapper = ({
conversations,
supportMode = false,
onSearch,
onChatOperation,
onNewBroadcast,
onNewMessage,
onItemClick,
}: InboxWrapperProps) => {
const render = (conversation: Conversation) => {
return (
<InboxListItemWrapper
supportMode={supportMode}
conversation={conversation}
onItemClick={() => onItemClick(conversation)}
onChatOperation={(operation) => onChatOperation?.(operation, conversation)}
/>
);
};
return (
<div className='flex h-full w-[29%] flex-col border-b border-r border-base/stroke max-lg:!w-[33%]'>
<InboxHeader
onNewBroadcast={onNewBroadcast}
onSearch={onSearch}
onNewMessage={onNewMessage}
title='New conversations'
/>
  {conversations !== undefined && (
    <div className='inbox-container-scrollable h-full w-full overflow-y-auto'>
      <CometChatConversations
        title=''
        listItemView={render}
        emptyStateView={<div />}
        conversationsRequestBuilder={conversations}
        loadingStateView={<SkeletonLoader sectionSkeleton />}
        conversationsStyle={conversationsStyle}
      />
    </div>
  )}
</div>

); };```

cometchat-helpcenter-bot commented 1 month ago

Gaurav Dhirendra Singh (CometChat Team) replied:

Could you please create a support ticket for this issue, so that we can investigate it further?

You can visit the following link to create a support ticket - https://help.cometchat.com/hc/en-us/requests/new

Gaurav Singh CometChat