From 1984e60c73f87d8d5668e028419ff89750787855 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 29 Jun 2023 20:14:39 +0530 Subject: [PATCH] api key length error toaster removed --- apps/etherscan/src/app/views/CaptureKeyView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/etherscan/src/app/views/CaptureKeyView.tsx b/apps/etherscan/src/app/views/CaptureKeyView.tsx index caa3869a2a..a9e81ce80f 100644 --- a/apps/etherscan/src/app/views/CaptureKeyView.tsx +++ b/apps/etherscan/src/app/views/CaptureKeyView.tsx @@ -23,6 +23,8 @@ export const CaptureKeyView: React.FC = () => { const errors = {} as any if (!values.apiKey) { errors.apiKey = "Required" + } else if (values.apiKey.length !== 34) { + errors.apiKey = "API key should be 34 characters long" } return errors }} @@ -32,7 +34,7 @@ export const CaptureKeyView: React.FC = () => { setAPIKey(values.apiKey) clientInstance.call('notification' as any, 'toast', 'API key saved successfully!!!') navigate((location && location.state ? location.state : '/')) - } else clientInstance.call('notification' as any, 'toast', 'API key should be 34 characters long') + } }} > {({ errors, touched, handleSubmit }) => ( @@ -57,7 +59,7 @@ export const CaptureKeyView: React.FC = () => {
- +
)}