Skip to content

Commit

Permalink
chore: Use same loading indicator for lp positions
Browse files Browse the repository at this point in the history
  • Loading branch information
memoyil committed Jan 6, 2025
1 parent 54d709a commit b78adb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useLatestTxReceipt } from './useLatestTxReceipt'
export const useAccountStableLpDetails = (chainIds: number[], account?: Address | null) => {
const [latestTxReceipt] = useLatestTxReceipt()

const { data, isPending } = useQuery<StableLPDetail[], Error>({
const { data, isPending, isLoading } = useQuery<StableLPDetail[], Error>({
queryKey: ['accountStableLpBalance', account, chainIds.join(','), latestTxReceipt?.blockHash],
// @todo @ChefJerry add signal
queryFn: async () => {
Expand Down Expand Up @@ -42,7 +42,7 @@ export const useAccountStableLpDetails = (chainIds: number[], account?: Address
return useMemo(
() => ({
data: data ?? [],
pending: isPending,
pending: isPending || isLoading,
}),
[data, isPending],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const useAccountV2LpDetails = (chainIds: number[], account?: Address | nu

const [latestTxReceipt] = useLatestTxReceipt()

const { data, isFetching, isLoading } = useQuery<V2LPDetail[], Error>({
const { data, isPending, isLoading } = useQuery<V2LPDetail[], Error>({
queryKey: ['accountV2LpDetails', account, chainIds.join('-'), totalTokenPairCount, latestTxReceipt?.blockHash],
queryFn: async () => {
if (!account || !lpTokensByChain) return []
Expand Down Expand Up @@ -73,8 +73,8 @@ export const useAccountV2LpDetails = (chainIds: number[], account?: Address | nu
return useMemo(
() => ({
data: data ?? [],
pending: isLoading || isFetching,
pending: isLoading || isPending,
}),
[data, isLoading, isFetching],
[data, isLoading, isPending],
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useLatestTxReceipt } from './useLatestTxReceipt'
export const useAccountV3Positions = (chainIds: number[], account?: Address | null) => {
const [latestTxReceipt] = useLatestTxReceipt()

const { data, isPending } = useQuery<PositionDetail[], Error>({
const { data, isPending, isLoading } = useQuery<PositionDetail[], Error>({
queryKey: ['accountV3Positions', account, chainIds.join('-'), latestTxReceipt?.blockHash],
// @todo @ChefJerry add signal
queryFn: async () => {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const useAccountV3Positions = (chainIds: number[], account?: Address | nu
return useMemo(
() => ({
data: data ?? [],
pending: isPending,
pending: isPending || isLoading,
}),
[data, isPending],
)
Expand Down

0 comments on commit b78adb8

Please sign in to comment.