···5959 enabled: enabled && !!moderationOpts,
6060 filter,
6161 })
6262- const isEmpty = !isFetching && !data?.pages[0]?.items.length
6262+ // previously, this was `!isFetching && !data?.pages[0]?.items.length`
6363+ // however, if the first page had no items (can happen in the mentions tab!)
6464+ // it would flicker the empty state whenever it was loading.
6565+ // therefore, we need to find if *any* page has items. in 99.9% of cases,
6666+ // the `.find()` won't need to go any further than the first page -sfn
6767+ const isEmpty =
6868+ !isFetching && !data?.pages.find(page => page.items.length > 0)
63696470 const items = React.useMemo(() => {
6571 let arr: any[] = []