@@ -51,6 +51,7 @@ const selector = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
5151 ( {
5252 channels : nextValue . channels ,
5353 pagination : nextValue . pagination ,
54+ ready : nextValue . ready ,
5455 } as const ) ;
5556
5657export const usePaginatedChannels = <
@@ -72,7 +73,7 @@ export const usePaginatedChannels = <
7273 const activeChannels = useActiveChannelsRefContext ( ) ;
7374 const isMountedRef = useIsMountedRef ( ) ;
7475 const { client } = useChatContext < StreamChatGenerics > ( ) ;
75- const { channels, pagination } = useStateStore ( channelManager ?. state , selector ) ?? { } ;
76+ const { channels, pagination, ready } = useStateStore ( channelManager ?. state , selector ) ?? { } ;
7677 const hasNextPage = pagination ?. hasNext ;
7778
7879 const filtersRef = useRef < typeof filters | null > ( null ) ;
@@ -296,7 +297,8 @@ export const usePaginatedChannels = <
296297 // ? true
297298 // : (activeQueryType.current === 'reload' || activeQueryType.current === null) &&
298299 // channels === null,
299- loadingChannels : activeQueryType . current === 'queryLocalDB' ? true : pagination ?. isLoading ,
300+ loadingChannels :
301+ activeQueryType . current === 'queryLocalDB' ? true : pagination ?. isLoading || ! ready ,
300302 loadingNextPage : pagination ?. isLoadingNext ,
301303 loadNextPage : channelManager . loadNext ,
302304 refreshing : activeQueryType . current === 'refresh' ,
0 commit comments