Compare commits

...

1 Commits

Author SHA1 Message Date
Eric Bailey 6ee2e42f55 Randomize the feeds shown in interstitial 2024-07-03 10:33:58 -05:00
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -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()
+2 -2
View File
@@ -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(
(