From e11b7026cbe680c635b5411666b99d9685cd9036 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 11 Apr 2023 21:24:37 +0530 Subject: [PATCH] toasters on save key --- apps/etherscan/src/app/views/CaptureKeyView.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/etherscan/src/app/views/CaptureKeyView.tsx b/apps/etherscan/src/app/views/CaptureKeyView.tsx index c728a9174a..b6492b9609 100644 --- a/apps/etherscan/src/app/views/CaptureKeyView.tsx +++ b/apps/etherscan/src/app/views/CaptureKeyView.tsx @@ -23,8 +23,12 @@ export const CaptureKeyView: React.FC = () => { return errors }} onSubmit={(values) => { - setAPIKey(values.apiKey) - navigate((location.state as any).from) + const apiKey = values.apiKey + if (apiKey.length === 34) { + setAPIKey(values.apiKey) + clientInstance.call('notification' as any, 'toast', 'API key saved successfully!!!') + navigate((location.state as any).from) + } else clientInstance.call('notification' as any, 'toast', 'API key should be 34 characters long') }} > {({ errors, touched, handleSubmit }) => (