Skip to content

Commit

Permalink
Fix incorrect expiry time (#6)
Browse files Browse the repository at this point in the history
Fix for incorrect expiry time
  • Loading branch information
dmanjunath authored Nov 3, 2020
2 parents 3949900 + 843a0d8 commit 3a39560
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/TransactionStatus/TransactionStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const WaitingTransaction: React.FC<WaitingTransactionProps> = props => {
}, [status, onClose])

// @ts-ignore
const { name, target, lockupDuration } = props
const { name, target } = props
const onCancelSubmit = useCallback(() => {
if (name === PendingTransactionName.RemoveDelegator) {
cancelTransaction(target)
Expand All @@ -95,7 +95,7 @@ const WaitingTransaction: React.FC<WaitingTransactionProps> = props => {
}, [name, target, cancelTransaction])
const { timeRemaining } = useTimeRemaining(
props.lockupExpiryBlock,
lockupDuration
0 /* period - 0 because lockupExpiry has time period baked in */
)

return (
Expand Down
2 changes: 1 addition & 1 deletion src/store/cache/protocol/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const useTimeRemaining = (block: number, period: number | null) => {
if (currentBlock > targetBlock) {
setTimeRemaining(0)
} else {
setTimeRemaining((targetBlock - currentBlock) * averageBlockTime)
setTimeRemaining((targetBlock - currentBlock) * averageBlockTime * 1000)
}
}
}, [averageBlockTime, currentBlock, block, period, targetBlock])
Expand Down

0 comments on commit 3a39560

Please sign in to comment.