[Problem/Question]
Hey, guys! Could you help me, please? I have two channel lists.
First - its group channels
Second - its private channels
But when choosing a group channel and sending a message this channel to 1-2 seconds shows in the private channels list and vice versa
I have a screen video for that -
And second bug is when I choose a channel (in the channel list) it shows in Channel but in the channel list this channel doesn’t highlight, but when I click a second time it is highlighted (it there is on video too)
This is my code -
const ChatComponent = ({ intl }) => {
// useState
const [showSettings, setShowSettings] = useState(false);
const [currentTripChannelUrl, setCurrentTripChannelUrl] = useState('');
const tripsChatTitle = intl.formatMessage({
id: 'ChatPage.tripsChatTitle',
});
const directChatTitle = intl.formatMessage({
id: 'ChatPage.directChatTitle',
});
const tripsChannelListHeader = () => {
return (
<div className={css.headerTitleWrapper}>
<span>{tripsChatTitle}</span>
</div>
);
};
const directChannelListHeader = () => {
return (
<div className={css.headerTitleWrapper}>
<span>{directChatTitle}</span>
</div>
);
};
return (
<div className={css.chatWrapper}>
<div className="sendbird-app__wrap">
<div className={css.channelListWrapper}>
<ChannelListProvider
onChannelSelect={channel => {
setCurrentTripChannelUrl(channel?.url);
}}
disableAutoSelect
queries={{
channelListQuery: {
includeEmpty: true,
customTypesFilter: [ChatTypes.GROUP_CHAT],
},
}}
className={css.channelList}
>
<ChannelListUI renderHeader={tripsChannelListHeader} />
</ChannelListProvider>
<ChannelListProvider
onChannelSelect={channel => {
if (channel && channel.url) {
setCurrentTripChannelUrl(channel.url);
}
}}
disableAutoSelect
queries={{
channelListQuery: {
includeEmpty: true,
customTypesFilter: [ChatTypes.PRIVATE_CHAT],
},
}}
className={css.channelList}
>
<ChannelListUI renderHeader={directChannelListHeader} />
</ChannelListProvider>
</div>
<div className="sendbird-app__conversation-wrap">
<Channel
channelUrl={currentTripChannelUrl}
onChatHeaderActionClick={() => {
setShowSettings(true);
}}
/>
</div>
</div>
{showSettings && (
<div className="sendbird-app__settingspanel-wrap">
<ChannelSettings
channelUrl={currentTripChannelUrl}
onCloseClick={() => {
setShowSettings(false);
}}
/>
</div>
)}
</div>
);
};
And now there are errors when I try to scroll messages in <Channel />
Uncaught TypeError: Cannot read properties of undefined (reading 'scrollTop')
at onScroll (vendors~TripChat.chunk.js:30861:29)
at vendors~TripChat.chunk.js:46125:7
at HTMLUnknownElement.callCallback (vendors~main.chunk.js:143216:18)
at Object.invokeGuardedCallbackDev (vendors~main.chunk.js:143265:20)
at invokeGuardedCallback (vendors~main.chunk.js:143318:35)
at invokeGuardedCallbackAndCatchFirstError (vendors~main.chunk.js:143333:29)
at executeDispatch (vendors~main.chunk.js:143418:7)
at executeDispatchesInOrder (vendors~main.chunk.js:143443:9)
at executeDispatchesAndRelease (vendors~main.chunk.js:146327:9)
at executeDispatchesAndReleaseTopLevel (vendors~main.chunk.js:146336:14)
at forEachAccumulated (vendors~main.chunk.js:146308:12)
at runEventsInBatch (vendors~main.chunk.js:146353:7)
at runExtractedPluginEventsInBatch (vendors~main.chunk.js:146563:7)
at handleTopLevel (vendors~main.chunk.js:146607:9)
at batchedEventUpdates$1 (vendors~main.chunk.js:164753:16)
at batchedEventUpdates (vendors~main.chunk.js:143825:16)
at dispatchEventForLegacyPluginEventSystem (vendors~main.chunk.js:146617:9)
at attemptToDispatchEvent (vendors~main.chunk.js:147337:9)
at dispatchEvent (vendors~main.chunk.js:147258:23)
at unstable_runWithPriority (vendors~main.chunk.js:195757:16)
at dispatchUserBlockingUpdate (vendors~main.chunk.js:147241:7)
[UIKit Version]
Latest - “@sendbird/uikit-react”: “^3.4.6”