Skip to content

Commit

Permalink
fix: trade countdown fixes (#7809)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Sep 25, 2024
1 parent b1bbb76 commit ac35b93
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ export const Hop = ({
)
)
case TransactionExecutionState.Pending:
// The hop may be pending, but it doesn't mean that it has been signed and broadcasted
if (!swap.sellTxHash) {
return (
tradeQuoteStep.estimatedExecutionTimeMs !== undefined && (
<RawText fontWeight='bold'>
{prettyMilliseconds(tradeQuoteStep.estimatedExecutionTimeMs)}
</RawText>
)
)
}
return (
tradeQuoteStep.estimatedExecutionTimeMs !== undefined && (
<TimeRemaining initialTimeMs={tradeQuoteStep.estimatedExecutionTimeMs} />
Expand All @@ -139,7 +149,7 @@ export const Hop = ({
default:
return null
}
}, [swap.state, tradeQuoteStep.estimatedExecutionTimeMs, onToggleIsOpen, isOpen])
}, [swap.state, swap.sellTxHash, tradeQuoteStep.estimatedExecutionTimeMs, onToggleIsOpen, isOpen])

const activeStep = useMemo(() => {
switch (hopExecutionState) {
Expand Down

0 comments on commit ac35b93

Please sign in to comment.