matbiz
November 14, 2024, 10:28am
1
[Problem/Question]
List of chats is not being updated when channelListQueryParams are changing. I’m using following query params:
const channelListQueryParams: ChannelListQueryParamsType = {
order: GroupChannelListOrder.LATEST_LAST_MESSAGE,
hiddenChannelFilter: ‘hidden_only’ / ‘unhidden_only’,
limit: 100,
};
And like you can see I’m switching hiddenChannelFilter between hidden and unhidden. However this doesn’t update chats list at all. This is how I’m using it:
<GroupChannelListFragment
onPressCreateChannel={navigateToGroupChannelCreateScreen}
onPressChannel={navigateToGroupChannelScreen}
// Render custom channel preview
renderGroupChannelPreview={(props) => {
return <CustomChannelPreview {…props} />;
}}
// Apply query parameters for channel list
channelListQueryParams={channelListQueryParams}
/>
It’s working on Chat SDK 4.12.10 but from version 4.13.0 it’s not working anymore, I’ve tried version up to 4.15.0.
[UIKit Version]
“@sendbird /chat”: “4.13.0”,+
“@sendbird /uikit-react-native”: “3.7.6”,
[Reproduction Steps]
Create GroupChannelList with import { createGroupChannelListFragment } from ‘@sendbird /uikit-react-native’;
Create channelListQueryParams like in example with possibility to change hiddenChannelFilter
Change hiddenChannelFilter. List is not being updated.
[Frequency]
Every time
[Current impact]
Feature doesn’t works.
imal
November 15, 2024, 7:17am
2
I’m facing the same issue, every time I change the filter, the list of chats does not re-render. Can somebody please suggest some workaround?
Hi @matbiz & @imal ,
Welcome to the Sendbird Community
Could you please try the following code and see if you are still facing any issues?
const loadChannels = async (channelHandlers) => {
const groupChannelFilter = new GroupChannelFilter();
groupChannelFilter.includeEmpty = true;
groupChannelFilter.hiddenChannelFilter = HiddenChannelFilter.HIDDEN;
const collection = sb.groupChannel.createGroupChannelCollection({
filter: groupChannelFilter,
order: GroupChannelListOrder.LATEST_LAST_MESSAGE,
});
collection.setGroupChannelCollectionHandler(channelHandlers);
const channels = await collection.loadMore();
return [channels, null];
}
Reference: HiddenChannelFilter | Sendbird Chat SDK Reference - v4.16.0
matbiz
November 22, 2024, 10:14am
6
Sure I can but where I should use this function? I want to use your component to show chat list and change filters. Like I mentioned changing filters was working in version 4.12.10 and after upgrade to 4.13.0 it’s not working anymore.
matbiz
December 12, 2024, 12:59pm
7
So I checked newest version of js sdk (4.16.1) with latest version of react native ui kit (3.8.2). Changing filters works partially, if I want show only hidden channels with HiddenChannelFilter.HIDDEN it shows empty list when on previous versions (js sdk: 4.12.10 and react native ui kit 3.7.0) it shows hidden channels.