Bluesky app fork with some witchin' additions 💫

Fixed an error found in #8969 for the Lists tab (#9502)

authored by RetroSunstar and committed by GitHub 960df7bf b4e1fdfc

Changed files
+12 -12
src
view
com
+12 -12
src/view/com/lists/ProfileLists.tsx
··· 22 22 import {logger} from '#/logger' 23 23 import {isIOS, isNative, isWeb} from '#/platform/detection' 24 24 import {usePreferencesQuery} from '#/state/queries/preferences' 25 - import {RQKEY, useProfileFeedgensQuery} from '#/state/queries/profile-feedgens' 25 + import {RQKEY, useProfileListsQuery} from '#/state/queries/profile-lists' 26 26 import {EmptyState} from '#/view/com/util/EmptyState' 27 27 import {ErrorMessage} from '#/view/com/util/error/ErrorMessage' 28 28 import {List, type ListRef} from '#/view/com/util/List' 29 29 import {FeedLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' 30 30 import {LoadMoreRetryBtn} from '#/view/com/util/LoadMoreRetryBtn' 31 31 import {atoms as a, ios, useTheme} from '#/alf' 32 - import * as FeedCard from '#/components/FeedCard' 33 32 import {BulletList_Stroke1_Corner0_Rounded as ListIcon} from '#/components/icons/BulletList' 33 + import * as ListCard from '#/components/ListCard' 34 34 import {ListFooter} from '#/components/Lists' 35 35 36 36 const LOADING = {_reactKey: '__loading__'} ··· 42 42 scrollToTop: () => void 43 43 } 44 44 45 - interface ProfileFeedgensProps { 45 + interface ProfileListsProps { 46 46 ref?: React.Ref<SectionRef> 47 47 did: string 48 48 scrollElRef: ListRef ··· 62 62 style, 63 63 testID, 64 64 setScrollViewTag, 65 - }: ProfileFeedgensProps) { 65 + }: ProfileListsProps) { 66 66 const {_} = useLingui() 67 67 const t = useTheme() 68 68 const [isPTRing, setIsPTRing] = useState(false) ··· 77 77 isError, 78 78 error, 79 79 refetch, 80 - } = useProfileFeedgensQuery(did, opts) 81 - const isEmpty = !isPending && !data?.pages[0]?.feeds.length 80 + } = useProfileListsQuery(did, opts) 81 + const isEmpty = !isPending && !data?.pages[0]?.lists.length 82 82 const {data: preferences} = usePreferencesQuery() 83 83 const navigation = useNavigation() 84 84 ··· 93 93 items = items.concat([EMPTY]) 94 94 } else if (data?.pages) { 95 95 for (const page of data?.pages) { 96 - items = items.concat(page.feeds) 96 + items = items.concat(page.lists) 97 97 } 98 98 } else if (isError && !isEmpty) { 99 99 items = items.concat([LOAD_MORE_ERROR_ITEM]) ··· 123 123 try { 124 124 await refetch() 125 125 } catch (err) { 126 - logger.error('Failed to refresh feeds', {message: err}) 126 + logger.error('Failed to refresh lists', {message: err}) 127 127 } 128 128 setIsPTRing(false) 129 129 }, [refetch, setIsPTRing]) ··· 134 134 try { 135 135 await fetchNextPage() 136 136 } catch (err) { 137 - logger.error('Failed to load more feeds', {message: err}) 137 + logger.error('Failed to load more lists', {message: err}) 138 138 } 139 139 }, [isFetchingNextPage, hasNextPage, isError, fetchNextPage]) 140 140 ··· 189 189 a.px_lg, 190 190 a.py_lg, 191 191 ]}> 192 - <FeedCard.Default view={item} /> 192 + <ListCard.Default view={item} /> 193 193 </View> 194 194 ) 195 195 } ··· 205 205 } 206 206 }, [enabled, scrollElRef, setScrollViewTag]) 207 207 208 - const ProfileFeedgensFooter = useCallback(() => { 208 + const ProfileListsFooter = useCallback(() => { 209 209 if (isEmpty) return null 210 210 return ( 211 211 <ListFooter ··· 233 233 data={items} 234 234 keyExtractor={keyExtractor} 235 235 renderItem={renderItem} 236 - ListFooterComponent={ProfileFeedgensFooter} 236 + ListFooterComponent={ProfileListsFooter} 237 237 refreshing={isPTRing} 238 238 onRefresh={onRefresh} 239 239 headerOffset={headerOffset}