Randomize the feeds shown in interstitial
This commit is contained in:
@@ -230,8 +230,15 @@ export function SuggestedFeeds() {
|
||||
const numFeedsToDisplay = 3
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
const [initialCursor] = React.useState(() => {
|
||||
const min = 9880
|
||||
const max = 9999
|
||||
const range = max - min
|
||||
return Math.floor(Math.random() * range) + min + ''
|
||||
})
|
||||
const {data, isLoading, error} = useGetPopularFeedsQuery({
|
||||
limit: numFeedsToDisplay,
|
||||
cursor: initialCursor,
|
||||
})
|
||||
const navigation = useNavigation<NavigationProp>()
|
||||
const {gtMobile} = useBreakpoints()
|
||||
|
||||
@@ -193,7 +193,7 @@ export const KNOWN_AUTHED_ONLY_FEEDS = [
|
||||
'at://did:plc:vpkhqolt662uhesyj6nxm7ys/app.bsky.feed.generator/followpics', // the gram, by why
|
||||
]
|
||||
|
||||
type GetPopularFeedsOptions = {limit?: number}
|
||||
type GetPopularFeedsOptions = {limit?: number; cursor?: string}
|
||||
|
||||
export function createGetPopularFeedsQueryKey(
|
||||
options?: GetPopularFeedsOptions,
|
||||
@@ -240,7 +240,7 @@ export function useGetPopularFeedsQuery(options?: GetPopularFeedsOptions) {
|
||||
|
||||
return res.data
|
||||
},
|
||||
initialPageParam: undefined,
|
||||
initialPageParam: options?.cursor,
|
||||
getNextPageParam: lastPage => lastPage.cursor,
|
||||
select: useCallback(
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user