Commit b3f5a0b5 authored by tom's avatar tom

Handle undefined timestamp for zkEVM batch

Fixes #1674
parent a5a42116
......@@ -5,7 +5,7 @@ export type ZkEvmL2TxnBatchesItem = {
verify_tx_hash: string | null;
sequence_tx_hash: string | null;
status: string;
timestamp: string;
timestamp: string | null;
tx_count: number;
}
......@@ -26,7 +26,7 @@ export type ZkEvmL2TxnBatch = {
sequence_tx_hash: string;
state_root: string;
status: typeof ZKEVM_L2_TX_BATCH_STATUSES[number];
timestamp: string;
timestamp: string | null;
transactions: Array<string>;
verify_tx_hash: string;
}
......
......@@ -86,7 +86,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
title="Timestamp"
isLoading={ isPlaceholderData }
>
<DetailsTimestamp timestamp={ data.timestamp } isLoading={ isPlaceholderData }/>
{ data.timestamp ? <DetailsTimestamp timestamp={ data.timestamp } isLoading={ isPlaceholderData }/> : 'Undefined' }
</DetailsInfoItem>
<DetailsInfoItem
title="Verify tx hash"
......@@ -98,7 +98,7 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
hash={ data.verify_tx_hash }
maxW="100%"
/>
) : <Text>pending</Text> }
) : <Text>Pending</Text> }
</DetailsInfoItem>
<DetailsInfoItem
title="Transactions"
......
......@@ -18,7 +18,7 @@ const rollupFeature = config.features.rollup;
type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean };
const ZkEvmTxnBatchesListItem = ({ item, isLoading }: Props) => {
const timeAgo = dayjs(item.timestamp).fromNow();
const timeAgo = item.timestamp ? dayjs(item.timestamp).fromNow() : 'Undefined';
if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') {
return null;
......
......@@ -17,7 +17,7 @@ const rollupFeature = config.features.rollup;
type Props = { item: ZkEvmL2TxnBatchesItem; isLoading?: boolean };
const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
const timeAgo = dayjs(item.timestamp).fromNow();
const timeAgo = item.timestamp ? dayjs(item.timestamp).fromNow() : 'Undefined';
if (!rollupFeature.isEnabled || rollupFeature.type !== 'zkEvm') {
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment