diff --git a/apps/etherscan/src/app/views/CaptureKeyView.tsx b/apps/etherscan/src/app/views/CaptureKeyView.tsx index e226d1e022..16969705f4 100644 --- a/apps/etherscan/src/app/views/CaptureKeyView.tsx +++ b/apps/etherscan/src/app/views/CaptureKeyView.tsx @@ -27,7 +27,7 @@ export const CaptureKeyView: React.FC = () => { if (apiKey.length === 34) { setAPIKey(values.apiKey) clientInstance.call('notification' as any, 'toast', 'API key saved successfully!!!') - navigate((location.state as any).from) + navigate((location && location.state ? location.state : '/')) } else clientInstance.call('notification' as any, 'toast', 'API key should be 34 characters long') }} >