Skip to content

Commit

Permalink
handle 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Mar 27, 2024
1 parent 3ac1f4c commit fb5cbae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,16 @@ export const getConfirmationDepositTime = (
};

if (amount.lte(limits.maxDepositInstant)) {
const fastFillTimeInSeconds = getFastFillTimeByRoute(fromChain, toChain);
const fastFillTimeInSeconds = Math.floor(
getFastFillTimeByRoute(fromChain, toChain)
);
const fastFillTimeInMinutes = Math.floor(fastFillTimeInSeconds / 60);
return {
formattedString:
fastFillTimeInSeconds < 60
? `~${Math.floor(fastFillTimeInSeconds)} seconds`
? `~${fastFillTimeInSeconds} ${
fastFillTimeInSeconds === 1 ? "second" : "seconds"
}`
: `~${fastFillTimeInMinutes} ${
fastFillTimeInMinutes === 1 ? "minute" : "minutes"
}`,
Expand Down

0 comments on commit fb5cbae

Please sign in to comment.