Add missing data output

This commit is contained in:
Willian Mitsuda 2021-09-18 15:40:19 -03:00
parent 450f2e72f3
commit 4605bca7a5
2 changed files with 12 additions and 1 deletions

View File

@ -321,7 +321,15 @@ const Details: React.FC<DetailsProps> = ({
<ModeTab>UTF-8</ModeTab>
</Tab.List>
<Tab.Panels>
<Tab.Panel>{txDesc && <DecodedInput txDesc={txDesc} />}</Tab.Panel>
<Tab.Panel>
{txDesc === undefined ? (
<>Waiting for data...</>
) : txDesc === null ? (
<>No decoded data</>
) : (
<DecodedInput txDesc={txDesc} />
)}
</Tab.Panel>
<Tab.Panel>
<textarea
className="w-full h-40 bg-gray-50 text-gray-500 font-mono focus:outline-none border rounded p-2"

View File

@ -127,6 +127,9 @@ export const useTransactionDescription = (
txData: TransactionData | null | undefined
) => {
const txDesc = useMemo(() => {
if (metadata === null) {
return null;
}
if (!metadata || !txData) {
return undefined;
}