File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/etherscan/src/app/views Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ export const CaptureKeyView: React.FC = () => {
2323 const errors = { } as any
2424 if ( ! values . apiKey ) {
2525 errors . apiKey = "Required"
26+ } else if ( values . apiKey . length !== 34 ) {
27+ errors . apiKey = "API key should be 34 characters long"
2628 }
2729 return errors
2830 } }
@@ -32,7 +34,7 @@ export const CaptureKeyView: React.FC = () => {
3234 setAPIKey ( values . apiKey )
3335 clientInstance . call ( 'notification' as any , 'toast' , 'API key saved successfully!!!' )
3436 navigate ( ( location && location . state ? location . state : '/' ) )
35- } else clientInstance . call ( 'notification' as any , 'toast' , 'API key should be 34 characters long' )
37+ }
3638 } }
3739 >
3840 { ( { errors, touched, handleSubmit } ) => (
@@ -57,7 +59,7 @@ export const CaptureKeyView: React.FC = () => {
5759 </ div >
5860
5961 < div >
60- < SubmitButton text = "Save" dataId = "save-api-key" disable = { false } />
62+ < SubmitButton text = "Save" dataId = "save-api-key" disable = { errors && errors . apiKey ? true : false } />
6163 </ div >
6264 </ form >
6365 ) }
You can’t perform that action at this time.
0 commit comments