From 8deb19bd3f5c6317d2ad74b6315b1f0ef693d2b7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 25 Jul 2024 15:41:59 +0100 Subject: [PATCH] fix comments --- src/ui/components/SignMessageButton/SignMessageButton.tsx | 4 ++-- .../SignTransactionButton/SignTransactionButton.tsx | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/components/SignMessageButton/SignMessageButton.tsx b/src/ui/components/SignMessageButton/SignMessageButton.tsx index f927b53d12..496e79880f 100644 --- a/src/ui/components/SignMessageButton/SignMessageButton.tsx +++ b/src/ui/components/SignMessageButton/SignMessageButton.tsx @@ -104,9 +104,9 @@ export const SignMessageButton = React.forwardRef(function SignMessageButton( const isError = personalSignMutation.isError || signTypedData_v4Mutation.isError; - // we have small delay after using holdable button + // there is a small delay after using a holdable button + // button should be disabled after successful sign to prevent a duplicating call const disabled = isLoading || isSuccess; - const title = buttonTitle || 'Sign'; return isDeviceAccount(wallet) ? ( diff --git a/src/ui/components/SignTransactionButton/SignTransactionButton.tsx b/src/ui/components/SignTransactionButton/SignTransactionButton.tsx index 377f9d3f5d..85e76f22dc 100644 --- a/src/ui/components/SignTransactionButton/SignTransactionButton.tsx +++ b/src/ui/components/SignTransactionButton/SignTransactionButton.tsx @@ -82,6 +82,9 @@ export const SignTransactionButton = React.forwardRef( const isLoading = isLoadingProp || sendTxMutation.isLoading; const isSending = sendTxMutation.isLoading; + + // there is a small delay after using a holdable button + // button should be disabled after successful sign to prevent a duplicating call const disabled = isLoading || sendTxMutation.isSuccess || disabledAttr; const title = buttonTitle || 'Confirm';