From 4e196eaa527be0f5f26cdbe3c112a55325146da4 Mon Sep 17 00:00:00 2001 From: tom Date: Fri, 9 Aug 2024 14:24:17 +0200 Subject: [PATCH] Hide toggle "Show external call data" when data is not available Fixes #2103 --- ui/userOp/UserOpCallData.tsx | 9 +++++---- ui/userOp/UserOpDecodedCallData.tsx | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ui/userOp/UserOpCallData.tsx b/ui/userOp/UserOpCallData.tsx index 6018606597..08e962f696 100644 --- a/ui/userOp/UserOpCallData.tsx +++ b/ui/userOp/UserOpCallData.tsx @@ -23,21 +23,22 @@ const UserOpDecodedCallData = ({ data }: Props) => { return null; } - const toggler = data.call_data ? ( + const toggler = data.call_data && data.execute_call_data ? ( ) : null; + const labelText = data.call_data && !data.execute_call_data ? 'External call data' : 'Call data'; + return ( <> - Call data + { labelText } diff --git a/ui/userOp/UserOpDecodedCallData.tsx b/ui/userOp/UserOpDecodedCallData.tsx index 19884ccc72..c896a23836 100644 --- a/ui/userOp/UserOpDecodedCallData.tsx +++ b/ui/userOp/UserOpDecodedCallData.tsx @@ -23,21 +23,22 @@ const UserOpDecodedCallData = ({ data }: Props) => { return null; } - const toggler = data.decoded_call_data ? ( + const toggler = data.decoded_call_data && data.decoded_execute_call_data ? ( ) : null; + const labelText = data.call_data && !data.execute_call_data ? 'Decoded external call data' : 'Decoded call data'; + return ( <> - Decoded call data + { labelText }