Skip to content

Commit 71dbb5f

Browse files
committed
chore: add explanation
1 parent 31eeadc commit 71dbb5f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

package/src/components/ChannelList/hooks/usePaginatedChannels.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,13 @@ export const usePaginatedChannels = <
300300
loadingChannels:
301301
activeQueryType.current === 'queryLocalDB'
302302
? true
303-
: pagination?.isLoading || (!ready && channels.length === 0),
303+
: // Although channels.length === 0 should come as a given when we have !ready,
304+
// due to the way offline storage works currently we have to do this additional
305+
// check to make sure channels were not populated before the reactive list becomes
306+
// ready. I do not like providing a way to set the ready state, as it should be managed
307+
// in the LLC entirely. Once we move offline support to the LLC, we can remove this check
308+
// too as it'll be redundant.
309+
pagination?.isLoading || (!ready && channels.length === 0),
304310
loadingNextPage: pagination?.isLoadingNext,
305311
loadNextPage: channelManager.loadNext,
306312
ready,

0 commit comments

Comments
 (0)