From 458ba594aa2d92e89fe8912d7b555c6e0f0bb230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=B3vis=20Neto?= Date: Tue, 17 Sep 2024 12:31:06 +0200 Subject: [PATCH] fix: show contract name when it is a multisend transaction --- src/components/tx/DecodedTx/index.tsx | 26 +------------------- src/components/tx/SignOrExecuteForm/hooks.ts | 3 +-- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/components/tx/DecodedTx/index.tsx b/src/components/tx/DecodedTx/index.tsx index c09e64beb9..a3d42fc37f 100644 --- a/src/components/tx/DecodedTx/index.tsx +++ b/src/components/tx/DecodedTx/index.tsx @@ -4,8 +4,6 @@ import { Accordion, AccordionDetails, AccordionSummary, Box, Skeleton, Stack } f import { OperationType, type SafeTransaction } from '@safe-global/safe-core-sdk-types' import type { DecodedDataResponse, TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' import { Operation } from '@safe-global/safe-gateway-typescript-sdk' -import useChainId from '@/hooks/useChainId' -import ErrorMessage from '../ErrorMessage' import Summary, { PartialSummary } from '@/components/transactions/TxDetails/Summary' import { trackEvent, MODALS_EVENTS } from '@/services/analytics' import Multisend from '@/components/transactions/TxDetails/TxData/DecodedData/Multisend' @@ -13,8 +11,6 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore' import DecodedData from '@/components/transactions/TxDetails/TxData/DecodedData' import accordionCss from '@/styles/accordion.module.css' import HelpToolTip from './HelpTooltip' -import { useGetTransactionDetailsQuery } from '@/store/gateway' -import { skipToken } from '@reduxjs/toolkit/query/react' import { asError } from '@/services/exceptions/utils' type DecodedTxProps = { @@ -37,28 +33,14 @@ export const Divider = () => ( const DecodedTx = ({ tx, - txId, + txDetails, decodedData, showMultisend = true, showMethodCall = false, }: DecodedTxProps): ReactElement => { - const chainId = useChainId() const isMultisend = !!decodedData?.parameters?.[0]?.valueDecoded const isMethodCallInAdvanced = !showMethodCall || (isMultisend && showMultisend) - const { - data: txDetails, - error: txDetailsError, - isLoading: txDetailsLoading, - } = useGetTransactionDetailsQuery( - chainId && txId - ? { - chainId, - txId, - } - : skipToken, - ) - const onChangeExpand = (_: SyntheticEvent, expanded: boolean) => { trackEvent({ ...MODALS_EVENTS.TX_DETAILS, label: expanded ? 'Open' : 'Close' }) } @@ -116,12 +98,6 @@ const DecodedTx = ({ )} {txDetails ? : tx && } - - {txDetailsLoading && } - - {txDetailsError && ( - Failed loading all transaction details - )} diff --git a/src/components/tx/SignOrExecuteForm/hooks.ts b/src/components/tx/SignOrExecuteForm/hooks.ts index 50c1156c7f..050df4b14c 100644 --- a/src/components/tx/SignOrExecuteForm/hooks.ts +++ b/src/components/tx/SignOrExecuteForm/hooks.ts @@ -44,8 +44,8 @@ export const useProposeTx = (safeTx?: SafeTransaction, txId?: string, origin?: s return useAsync( () => { - if (!safeTx) return if (txId) return getTransactionDetails(safe.chainId, txId) + if (!safeTx) return return proposeTx(safeTx, txId, origin) }, @@ -78,7 +78,6 @@ export const useTxActions = (): TxActions => { const proposeTx: TxActions['proposeTx'] = async (safeTx, txId, origin) => { assertTx(safeTx) - // assertWallet(wallet) return _propose(wallet?.address || safe.owners[0].value, safeTx, txId, origin) }