Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboydiamonds committed Sep 23, 2024
1 parent c63eb5d commit 8627728
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { constructStringifiedBridgeSelections } from './useBridgeValidations'
import { BridgeQuote } from '@/utils/types'

export const useConfirmNewBridgePrice = () => {
const triggerQuoteRef = useRef<any>(null)
const triggerQuoteRef = useRef<BridgeQuote | null>(null)
const bpsThreshold = 0.0001 // 1bps

const [hasQuoteOutputChanged, setHasQuoteOutputChanged] =
Expand Down Expand Up @@ -122,5 +122,9 @@ const calculateOutputRelativeDifference = (
const currentOutput = parseFloat(currentQuote.outputAmountString)
const previousOutput = parseFloat(currentQuote.outputAmountString)

if (previousOutput === 0) {
return null
}

return (previousOutput - currentOutput) / previousOutput
}
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ const StateManagedBridge = () => {
)
}

if (isTransactionUserRejectedError) {
if (isTransactionUserRejectedError(error)) {
getAndSetBridgeQuote()
}

Expand Down

0 comments on commit 8627728

Please sign in to comment.