Skip to content

Commit

Permalink
fix(chat-hooks): added guard to useGroupChannelListWithQuery init
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Mar 3, 2022
1 parent bb81801 commit 5ec16d9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export const useGroupChannelListWithQuery = (
clearChannels();
if (uid) {
queryRef.current = createGroupChannelListQuery(sdk, options?.queryCreator);

const channels = await queryRef.current.next();
updateChannels(channels, true);
if (queryRef.current?.hasNext) {
const channels = await queryRef.current.next();
updateChannels(channels, true);
}
}
},
[sdk, options?.queryCreator],
Expand Down

0 comments on commit 5ec16d9

Please sign in to comment.