Skip to content

Commit

Permalink
Removes deprecated field
Browse files Browse the repository at this point in the history
  • Loading branch information
abtestingalpha committed Nov 7, 2023
1 parent 804d636 commit 2b9ec0e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,18 @@ import { usePortfolioState } from '@/slices/portfolio/hooks'
export const inputRef = React.createRef<HTMLInputElement>()

export const InputContainer = () => {
const {
fromChainId,
fromToken,
fromValue,
bridgeTxHashes,
toChainId,
toToken,
} = useBridgeState()
const { fromChainId, fromToken, fromValue, toChainId, toToken } =
useBridgeState()
const [showValue, setShowValue] = useState('')

const [hasMounted, setHasMounted] = useState(false)
const previousBridgeTxHashesRef = useRef<string[]>([])

const { balancesAndAllowances } = usePortfolioState()

useEffect(() => {
setHasMounted(true)
}, [])

useEffect(() => {
const previousBridgeTxHashes = previousBridgeTxHashesRef.current

if (bridgeTxHashes.length !== previousBridgeTxHashes.length) {
setShowValue('')
}

previousBridgeTxHashesRef.current = bridgeTxHashes
}, [bridgeTxHashes])

const { isConnected } = useAccount()
const { chain } = useNetwork()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
setBridgeQuote,
setIsLoading,
setDestinationAddress,
addBridgeTxHash,
} from '@/slices/bridge/reducer'

import {
Expand Down Expand Up @@ -440,7 +439,6 @@ const StateManagedBridge = () => {
isSubmitted: false,
})
)
dispatch(addBridgeTxHash(tx))
dispatch(setBridgeQuote(EMPTY_BRIDGE_QUOTE_ZERO))
dispatch(setDestinationAddress(null))
dispatch(setShowDestinationAddress(false))
Expand Down
6 changes: 0 additions & 6 deletions packages/synapse-interface/slices/bridge/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export interface BridgeState {
isLoading: boolean
deadlineMinutes: number | null
destinationAddress: Address | null
bridgeTxHashes: string[] | null
pendingBridgeTransactions: PendingBridgeTransaction[]
}

Expand Down Expand Up @@ -86,7 +85,6 @@ export const initialState: BridgeState = {
isLoading: false,
deadlineMinutes: null,
destinationAddress: null,
bridgeTxHashes: [],
pendingBridgeTransactions: [],
}

Expand Down Expand Up @@ -468,9 +466,6 @@ export const bridgeSlice = createSlice({
setDestinationAddress: (state, action: PayloadAction<Address | null>) => {
state.destinationAddress = action.payload
},
addBridgeTxHash: (state, action: PayloadAction<string>) => {
state.bridgeTxHashes = [...state.bridgeTxHashes, action.payload]
},
},
extraReducers: (builder) => {
builder
Expand Down Expand Up @@ -577,7 +572,6 @@ export const {
setDeadlineMinutes,
setDestinationAddress,
setIsLoading,
addBridgeTxHash,
} = bridgeSlice.actions

export default bridgeSlice.reducer

0 comments on commit 2b9ec0e

Please sign in to comment.