Skip to content

Commit

Permalink
fix: Add isCreation check inside DecodedTx to render partial summary
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Sep 19, 2024
1 parent 60a0cba commit ffef011
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/tx/DecodedTx/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { type SyntheticEvent, type ReactElement, memo } from 'react'
import { isCustomTxInfo, isNativeTokenTransfer, isTransferTxInfo } from '@/utils/transaction-guards'
import {
isCustomTxInfo,
isMultisigDetailedExecutionInfo,
isNativeTokenTransfer,
isTransferTxInfo,
} from '@/utils/transaction-guards'
import { Accordion, AccordionDetails, AccordionSummary, Box, Stack } from '@mui/material'
import { OperationType, type SafeTransaction } from '@safe-global/safe-core-sdk-types'
import type { DecodedDataResponse, TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk'
Expand Down Expand Up @@ -46,6 +51,11 @@ const DecodedTx = ({

const addressInfoIndex = txDetails?.txData?.addressInfoIndex

const isCreation =
txDetails &&
isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo) &&
txDetails.detailedExecutionInfo.confirmations.length === 0

const txData = {
dataDecoded: decodedData,
to: { value: tx?.data.to || '' },
Expand Down Expand Up @@ -99,7 +109,7 @@ const DecodedTx = ({
</>
)}

{txDetails && !showDecodedData ? (
{txDetails && !showDecodedData && !isCreation ? (
<Summary txDetails={txDetails} defaultExpanded />
) : (
tx && <PartialSummary safeTx={tx} />
Expand Down

0 comments on commit ffef011

Please sign in to comment.