Fix wrong message when cant decode input

This commit is contained in:
Willian Mitsuda 2021-10-19 05:23:48 -03:00
parent bace76e12c
commit 70649af097
1 changed files with 5 additions and 2 deletions

View File

@ -75,7 +75,10 @@ const Details: React.FC<DetailsProps> = ({
const fourBytes = txData.to !== null ? rawInputTo4Bytes(txData.data) : "0x"; const fourBytes = txData.to !== null ? rawInputTo4Bytes(txData.data) : "0x";
const fourBytesEntry = use4Bytes(fourBytes); const fourBytesEntry = use4Bytes(fourBytes);
const fourBytesTxDesc = useMemo(() => { const fourBytesTxDesc = useMemo(() => {
if (!txData || !fourBytesEntry?.signature) { if (!fourBytesEntry) {
return fourBytesEntry;
}
if (!txData || !fourBytesEntry.signature) {
return undefined; return undefined;
} }
const sig = fourBytesEntry?.signature; const sig = fourBytesEntry?.signature;
@ -355,7 +358,7 @@ const Details: React.FC<DetailsProps> = ({
) : resolvedTxDesc === undefined ? ( ) : resolvedTxDesc === undefined ? (
<>Waiting for data...</> <>Waiting for data...</>
) : resolvedTxDesc === null ? ( ) : resolvedTxDesc === null ? (
<>No decoded data</> <>Can't decode data</>
) : ( ) : (
<DecodedParamsTable <DecodedParamsTable
args={resolvedTxDesc.args} args={resolvedTxDesc.args}