@@ -5,7 +5,7 @@ import { useInfiniteQuery } from '@tanstack/react-query'
55import { useInView } from 'react-intersection-observer'
66import { useAccount } from 'wagmi'
77import { useNetwork } from '../../../hooks/useNetwork'
8- import { getGetRuntimeRoflAppsQueryKey , GetRuntimeRoflmarketInstances } from '../../../nexus/api'
8+ import { getGetRuntimeRoflmarketInstancesQueryKey , GetRuntimeRoflmarketInstances } from '../../../nexus/api'
99import { MachineCard } from '../../../components/MachineCard'
1010
1111const pageLimit = 9
@@ -15,14 +15,20 @@ export const Machines: FC = () => {
1515 const { ref, inView } = useInView ( )
1616 const network = useNetwork ( )
1717
18- const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isFetched } = useInfiniteQuery ( {
19- queryKey : [ ...getGetRuntimeRoflAppsQueryKey ( network , 'sapphire' ) ] ,
20- queryFn : async ( { pageParam = 0 } ) => {
21- const result = await GetRuntimeRoflmarketInstances ( network , 'sapphire' , {
18+ const machinesQueryParams = ( pageParam = 0 ) =>
19+ [
20+ network ,
21+ 'sapphire' ,
22+ {
2223 limit : pageLimit ,
2324 offset : pageParam ,
2425 admin : address ,
25- } )
26+ } ,
27+ ] satisfies Parameters < typeof GetRuntimeRoflmarketInstances >
28+ const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isFetched } = useInfiniteQuery ( {
29+ queryKey : [ 'infinite' , ...getGetRuntimeRoflmarketInstancesQueryKey ( ...machinesQueryParams ( ) ) ] ,
30+ queryFn : async ( { pageParam = 0 } ) => {
31+ const result = await GetRuntimeRoflmarketInstances ( ...machinesQueryParams ( pageParam ) )
2632 return result
2733 } ,
2834 initialPageParam : 0 ,
0 commit comments