Randomize the feeds shown in interstitial
This commit is contained in:
@@ -230,8 +230,15 @@ export function SuggestedFeeds() {
|
|||||||
const numFeedsToDisplay = 3
|
const numFeedsToDisplay = 3
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
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({
|
const {data, isLoading, error} = useGetPopularFeedsQuery({
|
||||||
limit: numFeedsToDisplay,
|
limit: numFeedsToDisplay,
|
||||||
|
cursor: initialCursor,
|
||||||
})
|
})
|
||||||
const navigation = useNavigation<NavigationProp>()
|
const navigation = useNavigation<NavigationProp>()
|
||||||
const {gtMobile} = useBreakpoints()
|
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
|
'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(
|
export function createGetPopularFeedsQueryKey(
|
||||||
options?: GetPopularFeedsOptions,
|
options?: GetPopularFeedsOptions,
|
||||||
@@ -240,7 +240,7 @@ export function useGetPopularFeedsQuery(options?: GetPopularFeedsOptions) {
|
|||||||
|
|
||||||
return res.data
|
return res.data
|
||||||
},
|
},
|
||||||
initialPageParam: undefined,
|
initialPageParam: options?.cursor,
|
||||||
getNextPageParam: lastPage => lastPage.cursor,
|
getNextPageParam: lastPage => lastPage.cursor,
|
||||||
select: useCallback(
|
select: useCallback(
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user