Skip to content

Commit b40980d

Browse files
authored
Merge pull request #161 from Ojas13-git/feature/visit-dashboard-btn
added status
2 parents f5d178b + a11a2ed commit b40980d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/components/common/apiCalls/jiffyApis.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface UserOp {
1616
actualGasPrice: number;
1717
actualGasUsed: number | null;
1818
success: Boolean;
19+
status: true;
1920
revertReason: string | null;
2021
blockTime: number | null;
2122
timeSeenInAltMempool: number | null;

src/views/userOp/TransactionDetails.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ function TransactionDetails({ tableLoading, skeletonCards, item, addressMapping,
4949
const [invokes, setInvokes] = useState([] as Array<string>);
5050
const [values, setValues] = useState([] as Array<number>);
5151
const [type, setType] = useState('');
52+
useEffect(() => {
53+
if (item && item.status !== undefined) {
54+
item.status = true;
55+
}
56+
}, [item]);
57+
5258
const [tokenPrices, setTokenPrices] = useState<TokenPrices>({
5359
ETH: 0,
5460
MATIC: 0,
@@ -246,7 +252,7 @@ function TransactionDetails({ tableLoading, skeletonCards, item, addressMapping,
246252
icon="blockTime"
247253
title="Block Time"
248254
content={
249-
(item?.blockTime ?
255+
(item?.status ?
250256
<div className="flex items-center gap-[10px]">
251257
<span className="text-dark-600 md:text-[14px] text-[16px] break-all leading-5">
252258
{`${moment.unix(item?.blockTime!).local().format()} (${moment.unix(item?.blockTime).fromNow()} )`}
@@ -312,7 +318,7 @@ function TransactionDetails({ tableLoading, skeletonCards, item, addressMapping,
312318
icon="gasFee"
313319
title="Gas Fee"
314320
content={
315-
item?.actualGasCost ? (
321+
item?.status ? (
316322
<div className="flex items-center gap-[10px]">
317323
<DisplayFee item={item?.actualGasCost ? item.actualGasCost : "not mined"} network={item?.network} />
318324
<div className="px-2 mt-2 bg-gray-200 rounded-lg">
@@ -341,7 +347,7 @@ function TransactionDetails({ tableLoading, skeletonCards, item, addressMapping,
341347
icon="gasUsed"
342348
title="Gas Used"
343349
content={
344-
item?.actualGasUsed ? (
350+
item?.status ? (
345351
<div className="flex items-center gap-[10px]">
346352
{item.actualGasUsed}
347353
</div>
@@ -379,7 +385,7 @@ function TransactionDetails({ tableLoading, skeletonCards, item, addressMapping,
379385
title="Beneficiary"
380386
content={
381387
<>
382-
<RenderTextCopyLink text={item?.beneficiary ? item.beneficiary : "not mined"} network={item?.network} type="bundler" />
388+
<RenderTextCopyLink text={item?.status ? item.beneficiary : "not mined"} network={item?.network} type="bundler" />
383389
<PowerButton item={item?.beneficiary?.toLowerCase()} addressMapping={addressMapping} />
384390
</>
385391
}
@@ -388,13 +394,13 @@ function TransactionDetails({ tableLoading, skeletonCards, item, addressMapping,
388394
icon="transactionHash"
389395
title="Transaction Hash"
390396
content={
391-
<RenderTextCopyLink text={item?.transactionHash ? item.transactionHash : "not mined"} network={item?.network} type="bundle" />
397+
<RenderTextCopyLink text={item?.status ? item.transactionHash : "not mined"} network={item?.network} type="bundle" />
392398
}
393399
/>
394400
<InfoSection
395401
icon="block"
396402
title="Block"
397-
content={<RenderTextCopyLink text={item?.blockNumber ? item.blockNumber : "not mined"} network={item?.network} type="block" />}
403+
content={<RenderTextCopyLink text={item?.status ? item.blockNumber : "not mined"} network={item?.network} type="block" />}
398404
/>
399405
{item?.paymasterRevertReason && (
400406
<InfoSection

0 commit comments

Comments
 (0)