Skip to content

Commit

Permalink
fix: mf-5050 candidate state could be undefined (#10477)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill committed Aug 18, 2023
1 parent fd6ed47 commit c2176b1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const TransactionDetail = memo(function TransactionDetail() {
const { classes, cx, theme } = useStyles()
const location = useLocation()
const transactionState = location.state.transaction as TransactionState
const candidateState = location.state.candidate as EvmTransaction
const candidateState = location.state.candidate as EvmTransaction | undefined
const isRecentTx = transactionState && 'candidates' in transactionState
const transaction = isRecentTx ? transactionState.candidates[transactionState.id] : transactionState
const account = useAccount()
Expand All @@ -162,7 +162,7 @@ export const TransactionDetail = memo(function TransactionDetail() {

const { data: txInput, isLoading: loadingTxInput } = useQuery({
enabled:
!!transaction && !loadingTx && !tx?.input && transactionState?.type === 'transfer' && !candidateState.data,
!!transaction && !loadingTx && !tx?.input && transactionState?.type === 'transfer' && !candidateState?.data,
queryKey: [transaction?.chainId, transactionId],
queryFn: async () => {
if (!chainId || !transactionId) return
Expand Down

0 comments on commit c2176b1

Please sign in to comment.