Skip to content

Commit

Permalink
fix: type
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisling-dev committed Sep 24, 2024
1 parent f9306d8 commit 970c524
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/portal/src/components/widgets/chainflip-swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,14 @@ export const ChainFlipSwap: React.FC = () => {
loading={swapping}
onClick={() => {
setInfoTab('details')
if (quote.state === 'hasData' && quote.data && fastBalance?.balance) {
swap(quote.data.quote.protocol, fromAmount.planck > fastBalance.balance.stayAlive.planck)
if (
quote.state === 'hasData' &&
quote.data &&
fastBalance?.balance &&
quote.data.quote.state === 'hasData' &&
quote.data.quote.data
) {
swap(quote.data.quote.data.protocol, fromAmount.planck > fastBalance.balance.stayAlive.planck)
}
}}
>
Expand Down

0 comments on commit 970c524

Please sign in to comment.