diff --git a/apps/app/src/components/Transactions/Execution.tsx b/apps/app/src/components/Transactions/Execution.tsx index 10dedcbf3..659c64afa 100644 --- a/apps/app/src/components/Transactions/Execution.tsx +++ b/apps/app/src/components/Transactions/Execution.tsx @@ -45,13 +45,13 @@ const Execution = (props: Props) => { const receipt = parseReceipt ? parseReceipt( txn.receipts.find( - (rpcReceipt) => rpcReceipt.receipt_id === receiptOutcome.id, + (rpcReceipt) => rpcReceipt?.receipt_id === receiptOutcome?.id, ), receiptOutcome, txn.transaction, ) : ''; - return mapping.set(receiptOutcome.id, { + return mapping.set(receiptOutcome?.id, { ...receipt, outcome: parseOutcomeOld ? parseOutcomeOld(receiptOutcome) : '', }); @@ -59,7 +59,7 @@ const Execution = (props: Props) => { const receipts = collectNestedReceiptWithOutcomeOld ? collectNestedReceiptWithOutcomeOld( - txn.transaction_outcome.outcome.receipt_ids[0], + txn?.transaction_outcome?.outcome?.receipt_ids[0], receiptsMap, ) : ''; diff --git a/apps/app/src/components/Transactions/Receipt.tsx b/apps/app/src/components/Transactions/Receipt.tsx index 8278af63a..4e35b428f 100644 --- a/apps/app/src/components/Transactions/Receipt.tsx +++ b/apps/app/src/components/Transactions/Receipt.tsx @@ -30,12 +30,12 @@ const Receipt = (props: Props) => { if ( receipts?.length === 0 || - receipts[0]?.receipt_id !== receiptsOutcome[0]?.id + receipts?.[0]?.receipt_id !== receiptsOutcome?.[0]?.id ) { receipts?.unshift({ predecessor_id: txn?.transaction?.signer_id, receipt: actions, - receipt_id: receiptsOutcome[0]?.id, + receipt_id: receiptsOutcome?.[0]?.id ?? '', receiver_id: txn?.transaction?.receiver_id, }); } @@ -78,7 +78,7 @@ const Receipt = (props: Props) => { }; }; - return collectReceipts(receiptsOutcome[0]?.id); + return collectReceipts(receiptsOutcome?.[0]?.id); } useEffect(() => { diff --git a/apps/app/src/components/Transactions/ReceiptSummary.tsx b/apps/app/src/components/Transactions/ReceiptSummary.tsx index 25904da1b..94709b3b0 100644 --- a/apps/app/src/components/Transactions/ReceiptSummary.tsx +++ b/apps/app/src/components/Transactions/ReceiptSummary.tsx @@ -33,12 +33,12 @@ const ReceiptSummary = (props: Props) => { if ( receipts?.length === 0 || - receipts[0]?.receipt_id !== receiptsOutcome[0]?.id + receipts?.[0]?.receipt_id !== receiptsOutcome?.[0]?.id ) { receipts?.unshift({ predecessor_id: txn?.transaction?.signer_id, receipt: actions, - receipt_id: receiptsOutcome[0]?.id, + receipt_id: receiptsOutcome?.[0]?.id, receiver_id: txn?.transaction?.receiver_id, }); } @@ -56,7 +56,7 @@ const ReceiptSummary = (props: Props) => { receiptsByIdMap?.set(receiptItem?.receipt_id, { ...receiptItem, actions: - receiptItem?.receipt_id === receiptsOutcome[0]?.id + receiptItem?.receipt_id === receiptsOutcome?.[0]?.id ? actions : receiptItem?.receipt?.Action?.actions && receiptItem?.receipt?.Action?.actions.map((receipt) => @@ -81,7 +81,7 @@ const ReceiptSummary = (props: Props) => { }; }; - return collectReceipts(receiptsOutcome[0]?.id); + return collectReceipts(receiptsOutcome?.[0]?.id); } useEffect(() => { diff --git a/apps/app/src/components/Transactions/Tree.tsx b/apps/app/src/components/Transactions/Tree.tsx index d4f1fd132..dd7d1fdb3 100644 --- a/apps/app/src/components/Transactions/Tree.tsx +++ b/apps/app/src/components/Transactions/Tree.tsx @@ -26,12 +26,12 @@ const Tree = (props: Props) => { if ( receipts?.length === 0 || - receipts[0]?.receipt_id !== receiptsOutcome[0]?.id + receipts?.[0]?.receipt_id !== receiptsOutcome?.[0]?.id ) { receipts?.unshift({ predecessor_id: txn?.transaction?.signer_id, receipt: actions, - receipt_id: receiptsOutcome[0]?.id, + receipt_id: receiptsOutcome?.[0]?.id, receiver_id: txn?.transaction?.receiver_id, }); } @@ -74,7 +74,7 @@ const Tree = (props: Props) => { }; }; - return collectReceipts(receiptsOutcome[0]?.id); + return collectReceipts(receiptsOutcome?.[0]?.id); } useEffect(() => { diff --git a/apps/app/src/hooks/useHash.ts b/apps/app/src/hooks/useHash.ts index 5b7ace6a1..1c0207e1e 100644 --- a/apps/app/src/hooks/useHash.ts +++ b/apps/app/src/hooks/useHash.ts @@ -8,14 +8,10 @@ const useHash = (): [string | undefined, (newHash: string) => void] => { const setHash = useCallback( (newHash: string) => { - push( - { - pathname: new URL(asPath, 'http://localhost/').pathname, - hash: newHash, - }, - undefined, - { shallow: true }, - ); + if (asPath) { + const pathname = asPath.split('#')[0]; + push({ pathname, hash: newHash }, undefined, { shallow: true }); + } }, [asPath, push], );