Hi, I’m facing a problem that the group channel collection handler not trigger properly when user does not have any joined channels before.
Steps:
-
initialJoinedChannels
is empty - user join a channel
-
onChannelsAdded
not trigger (Unexpected) - refresh page
-
initialJoinedChannels
has one channel one (expected) - user join another channel
-
onChannelsAdded
trigger properly (expected)
const groupChannelFilter = new GroupChannelFilter();
groupChannelFilter.includeEmpty = true;
const collection = sb.groupChannel.createGroupChannelCollection({
filter: groupChannelFilter,
order: GroupChannelListOrder.LATEST_LAST_MESSAGE,
limit: PAGE_SIZE,
});
collection.setGroupChannelCollectionHandler({
onChannelsAdded: (c, channels) => {
console.info("On channels added", c.source);
},
onChannelsUpdated: (c, channels) => {
console.info("On channels updated", c.source);
},
onChannelsDeleted: (c, channelIds) => {
console.info("On channels delted", c.source);
},
});
const initialJoinedChannels = await collection.loadMore();
refs @sendbird/chat": "4.0.0-beta.9