Simplify logic
This commit is contained in:
parent
0f35d205e4
commit
b0c31441c4
|
@ -26,7 +26,12 @@ const AddressTransactionByNonce: React.FC<AddressTransactionByNonceProps> = ({
|
||||||
);
|
);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
if (checksummedAddress !== undefined && isNaN(nonce)) {
|
if (checksummedAddress === undefined) {
|
||||||
|
return <StandardFrame />;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Garbage nonce
|
||||||
|
if (isNaN(nonce)) {
|
||||||
return (
|
return (
|
||||||
<StandardFrame>
|
<StandardFrame>
|
||||||
<AddressOrENSNameInvalidNonce
|
<AddressOrENSNameInvalidNonce
|
||||||
|
@ -36,7 +41,9 @@ const AddressTransactionByNonce: React.FC<AddressTransactionByNonceProps> = ({
|
||||||
</StandardFrame>
|
</StandardFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (checksummedAddress !== undefined && !isNaN(nonce) && txHash === null) {
|
|
||||||
|
// Valid nonce, but no tx found
|
||||||
|
if (!txHash) {
|
||||||
return (
|
return (
|
||||||
<StandardFrame>
|
<StandardFrame>
|
||||||
<AddressOrENSNameInvalidNonce
|
<AddressOrENSNameInvalidNonce
|
||||||
|
@ -46,9 +53,9 @@ const AddressTransactionByNonce: React.FC<AddressTransactionByNonceProps> = ({
|
||||||
</StandardFrame>
|
</StandardFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (txHash) {
|
|
||||||
|
// Success; replace and render filler
|
||||||
navigate(transactionURL(txHash), { replace: true });
|
navigate(transactionURL(txHash), { replace: true });
|
||||||
}
|
|
||||||
return <StandardFrame />;
|
return <StandardFrame />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue