Skip to content

Commit

Permalink
Clear swap input after successful swap executed
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboydiamonds committed Mar 2, 2024
1 parent 3c7607e commit d4a3059
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { SwapChainSelector } from './SwapChainSelector'
import { SwapFromTokenSelector } from './SwapFromTokenSelector'
import { usePortfolioState } from '@/slices/portfolio/hooks'
import { updateSwapFromValue } from '@/slices/swap/reducer'
import { initialState, updateSwapFromValue } from '@/slices/swap/reducer'
import { useSwapState } from '@/slices/swap/hooks'

export const SwapInputContainer = () => {
Expand Down Expand Up @@ -51,6 +51,10 @@ export const SwapInputContainer = () => {
) {
setShowValue(swapFromValue)
}

if (swapFromValue === initialState.swapFromValue) {
setShowValue(initialState.swapFromValue)
}
}, [swapFromValue, swapChainId, swapFromToken])

const handleFromValueChange = (
Expand Down

0 comments on commit d4a3059

Please sign in to comment.