Skip to content

Commit

Permalink
Refetch address data before sending tx
Browse files Browse the repository at this point in the history
Closes #1056
  • Loading branch information
nop33 committed Dec 17, 2024
1 parent 1de048a commit 8626d09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/desktop-wallet/src/features/send/SendModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useTranslation } from 'react-i18next'
import styled from 'styled-components'

import { fadeIn } from '@/animations'
import queryClient from '@/api/queryClient'
import { buildSweepTransactions } from '@/api/transactions'
import PasswordConfirmation from '@/components/PasswordConfirmation'
import useAnalytics from '@/features/analytics/useAnalytics'
Expand Down Expand Up @@ -312,6 +313,12 @@ function SendModal<PT extends { fromAddress: Address }>({
}
}, [onClose, step])

useEffect(() => {
if (step === 'build-tx') {
queryClient.invalidateQueries({ queryKey: ['address', addressesData.fromAddress.hash, 'balance'] })
}
}, [addressesData.fromAddress.hash, step])

const confirmPassword = () => setStep('password-check')

const onBackCallback = {
Expand Down

0 comments on commit 8626d09

Please sign in to comment.