From 13f32f8a356c8b82efea773a2084b264cc4d9c10 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Thu, 23 Sep 2021 18:46:08 -0300 Subject: [PATCH] Properly differentiate pending/cant decode log data --- src/transaction/LogEntry.tsx | 14 +++++++++++++- src/transaction/Logs.tsx | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/transaction/LogEntry.tsx b/src/transaction/LogEntry.tsx index 0ce96dd..1d4e85f 100644 --- a/src/transaction/LogEntry.tsx +++ b/src/transaction/LogEntry.tsx @@ -50,7 +50,19 @@ const LogEntry: React.FC = ({ txData, log, logDesc }) => ( - {logDesc && ( + {logDesc === undefined ? ( +
+
+ Waiting for data... +
+
+ ) : logDesc === null ? ( +
+
+ No decoded data +
+
+ ) : ( <>
diff --git a/src/transaction/Logs.tsx b/src/transaction/Logs.tsx index 72258f0..45fe491 100644 --- a/src/transaction/Logs.tsx +++ b/src/transaction/Logs.tsx @@ -33,7 +33,7 @@ const Logs: React.FC = ({ txData, metadata }) => { 1, sourcifySource ); - const logDesc = useMemo(() => { + const logDescs = useMemo(() => { if (!txData) { return undefined; } @@ -41,7 +41,7 @@ const Logs: React.FC = ({ txData, metadata }) => { return txData.confirmedData?.logs.map((l) => { const mt = metadatas[l.address]; if (!mt) { - return undefined; + return mt; } const abi = mt.output.abi; @@ -69,7 +69,7 @@ const Logs: React.FC = ({ txData, metadata }) => { key={i} txData={txData} log={l} - logDesc={logDesc?.[i]} + logDesc={logDescs?.[i]} /> ))}