Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refresh rfox information after unstaking and claiming #7613

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/pages/RFOX/components/Claim/Claim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AnimatePresence } from 'framer-motion'
import { lazy, Suspense, useCallback, useState } from 'react'
import { MemoryRouter, Route, Switch, useLocation } from 'react-router'
import { makeSuspenseful } from 'utils/makeSuspenseful'
import { getAddress } from 'viem'
import { useGetUnstakingRequestCountQuery } from 'pages/RFOX/hooks/useGetUnstakingRequestCountQuery'
import { useGetUnstakingRequestsQuery } from 'pages/RFOX/hooks/useGetUnstakingRequestsQuery'

Expand Down Expand Up @@ -56,13 +55,13 @@ export const ClaimRoutes: React.FC<ClaimRouteProps> = ({ headerComponent, setSte

const { queryKey: unstakingRequestCountQueryKey } = useGetUnstakingRequestCountQuery({
stakingAssetAccountAddress: confirmedQuote
? getAddress(fromAccountId(confirmedQuote.stakingAssetAccountId).account)
? fromAccountId(confirmedQuote.stakingAssetAccountId).account
: undefined,
})

const { queryKey: unstakingRequestQueryKey } = useGetUnstakingRequestsQuery({
stakingAssetAccountAddress: confirmedQuote
? getAddress(fromAccountId(confirmedQuote.stakingAssetAccountId).account)
? fromAccountId(confirmedQuote.stakingAssetAccountId).account
: undefined,
})

Expand Down
7 changes: 3 additions & 4 deletions src/pages/RFOX/components/Unstake/Unstake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AnimatePresence } from 'framer-motion'
import React, { lazy, Suspense, useCallback, useState } from 'react'
import { MemoryRouter, Route, Switch, useLocation } from 'react-router'
import { makeSuspenseful } from 'utils/makeSuspenseful'
import { getAddress } from 'viem'
import { useGetUnstakingRequestCountQuery } from 'pages/RFOX/hooks/useGetUnstakingRequestCountQuery'
import { useGetUnstakingRequestsQuery } from 'pages/RFOX/hooks/useGetUnstakingRequestsQuery'
import { useStakingBalanceOfQuery } from 'pages/RFOX/hooks/useStakingBalanceOfQuery'
Expand Down Expand Up @@ -63,7 +62,7 @@ export const UnstakeRoutes: React.FC<UnstakeRouteProps> = ({ headerComponent })

const { queryKey: userStakingBalanceOfCryptoBaseUnitQueryKey } = useStakingInfoQuery({
stakingAssetAccountAddress: confirmedQuote
? getAddress(fromAccountId(confirmedQuote.stakingAssetAccountId).account)
? fromAccountId(confirmedQuote.stakingAssetAccountId).account
: undefined,
})

Expand All @@ -74,13 +73,13 @@ export const UnstakeRoutes: React.FC<UnstakeRouteProps> = ({ headerComponent })

const { queryKey: unstakingRequestCountQueryKey } = useGetUnstakingRequestCountQuery({
stakingAssetAccountAddress: confirmedQuote
? getAddress(fromAccountId(confirmedQuote.stakingAssetAccountId).account)
? fromAccountId(confirmedQuote.stakingAssetAccountId).account
: undefined,
})

const { queryKey: unstakingRequestQueryKey } = useGetUnstakingRequestsQuery({
stakingAssetAccountAddress: confirmedQuote
? getAddress(fromAccountId(confirmedQuote.stakingAssetAccountId).account)
? fromAccountId(confirmedQuote.stakingAssetAccountId).account
: undefined,
})

Expand Down
Loading