Skip to content

Commit 0dede32

Browse files
committed
Increase artist coin page size in buy sell flow (#13249)
### Description Temp fix for this PR: #13243 Not the ideal solution but will work for now. Real fix involves big refactor. ### How Has This Been Tested? https://github.com/user-attachments/assets/c91ee537-0032-4679-8021-a5d17a06e9e4
1 parent 9d971b2 commit 0dede32

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

packages/common/src/api/tan-query/tokens/useTokenPair.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { queryOptions, useQuery } from '@tanstack/react-query'
22

3-
import { transformArtistCoinsToTokenInfoMap } from '~/api'
3+
import {
4+
TEMP_ARTIST_COINS_PAGE_SIZE,
5+
transformArtistCoinsToTokenInfoMap
6+
} from '~/api'
47
import { TokenPair } from '~/store'
58
import {
69
createFallbackPair,
@@ -54,7 +57,9 @@ export const useTokenPair = (
5457
options?: Partial<ReturnType<typeof getTokenPairOptions>>
5558
) => {
5659
const context = useQueryContext()
57-
const { data: artistCoins = [], isLoading: coinsLoading } = useArtistCoins()
60+
const { data: artistCoins = [], isLoading: coinsLoading } = useArtistCoins({
61+
pageSize: TEMP_ARTIST_COINS_PAGE_SIZE
62+
})
5863

5964
// Create tokens map
6065
const tokensMap = transformArtistCoinsToTokenInfoMap(artistCoins)

packages/common/src/api/tan-query/tokens/useTokens.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ import { transformArtistCoinsToTokenInfoMap, useQueryContext } from '~/api'
44

55
import { useArtistCoins } from '../coins/useArtistCoins'
66

7+
export const TEMP_ARTIST_COINS_PAGE_SIZE = 100
8+
79
// Simple hook to get tokens from API without the complex pair logic
810
export const useTokens = () => {
9-
const { data: artistCoins = [], isLoading, error } = useArtistCoins()
11+
const {
12+
data: artistCoins = [],
13+
isLoading,
14+
error
15+
} = useArtistCoins({ pageSize: TEMP_ARTIST_COINS_PAGE_SIZE })
1016
const { env } = useQueryContext()
1117

1218
return useMemo(() => {

packages/web/src/components/buy-sell-modal/BuyTab.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useEffect, useMemo, useRef, useState } from 'react'
22

33
import {
4+
TEMP_ARTIST_COINS_PAGE_SIZE,
45
transformArtistCoinsToTokenInfoMap,
56
useArtistCoin,
67
useArtistCoins
@@ -68,7 +69,9 @@ export const BuyTab = ({
6869
onInputValueChange
6970
})
7071

71-
const { data: coins } = useArtistCoins()
72+
const { data: coins } = useArtistCoins({
73+
pageSize: TEMP_ARTIST_COINS_PAGE_SIZE
74+
})
7275
const artistCoins: TokenInfo[] = useMemo(() => {
7376
return Object.values(transformArtistCoinsToTokenInfoMap(coins ?? []))
7477
}, [coins])

0 commit comments

Comments
 (0)