Skip to content

Commit

Permalink
fix: fixed pending tx receipt time
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Dec 18, 2024
1 parent 54b42ed commit 816966c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/common/components/transaction-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,18 @@ export interface TxItemProps extends FlexProps {
}

const getTransactionTime = (tx: Transaction | MempoolTransaction) => {
if ((tx as any).block_time !== 'undefined' && (tx as any).block_time !== -1) {
if (
(tx as any).block_time &&
typeof (tx as any).block_time !== 'undefined' &&
(tx as any).block_time !== -1

Check warning on line 36 in src/common/components/transaction-item.tsx

View check run for this annotation

Codecov / codecov/patch

src/common/components/transaction-item.tsx#L35-L36

Added lines #L35 - L36 were not covered by tests
) {
return (tx as any).block_time;
}
if (typeof (tx as any).burn_block_time !== 'undefined' && (tx as any).burn_block_time !== -1) {
if (
(tx as any).burn_block_time &&
typeof (tx as any).burn_block_time !== 'undefined' &&
(tx as any).burn_block_time !== -1

Check warning on line 43 in src/common/components/transaction-item.tsx

View check run for this annotation

Codecov / codecov/patch

src/common/components/transaction-item.tsx#L42-L43

Added lines #L42 - L43 were not covered by tests
) {
return (tx as any).burn_block_time;
} else if ((tx as any).burn_block_time === -1) {
return (tx as any).parent_burn_block_time;
Expand Down

0 comments on commit 816966c

Please sign in to comment.