diff --git a/apps/etherscan/src/app/views/CaptureKeyView.tsx b/apps/etherscan/src/app/views/CaptureKeyView.tsx index 16969705f4..22e9c65baa 100644 --- a/apps/etherscan/src/app/views/CaptureKeyView.tsx +++ b/apps/etherscan/src/app/views/CaptureKeyView.tsx @@ -12,7 +12,11 @@ export const CaptureKeyView: React.FC = () => { return ( {({ apiKey, clientInstance, setAPIKey }) => { - if (!apiKey && clientInstance && clientInstance.call) clientInstance.call('notification' as any, 'toast', 'Please add API key to continue') + if (!apiKey && clientInstance && clientInstance.call) { + clientInstance.call('sidePanel' as any, 'currentFocus').then((current) => { + if (current === 'etherscan') clientInstance.call('notification' as any, 'toast', 'Please add API key to continue') + }) + } return { diff --git a/apps/etherscan/src/app/views/HomeView.tsx b/apps/etherscan/src/app/views/HomeView.tsx index 14070ee6e0..1379ff480d 100644 --- a/apps/etherscan/src/app/views/HomeView.tsx +++ b/apps/etherscan/src/app/views/HomeView.tsx @@ -12,7 +12,11 @@ export const HomeView: React.FC = () => { return ( {({ apiKey, clientInstance, setReceipts, receipts, contracts }) => { - if (!apiKey && clientInstance && clientInstance.call) clientInstance.call('notification' as any, 'toast', 'Please add API key to continue') + if (!apiKey && clientInstance && clientInstance.call) { + clientInstance.call('sidePanel' as any, 'currentFocus').then((current) => { + if (current === 'etherscan') clientInstance.call('notification' as any, 'toast', 'Please add API key to continue') + }) + } return !apiKey ? ( { return ( {({ apiKey, clientInstance, receipts, setReceipts }) => { - if (!apiKey && clientInstance && clientInstance.call) clientInstance.call('notification' as any, 'toast', 'Please add API key to continue') + if (!apiKey && clientInstance && clientInstance.call) { + clientInstance.call('sidePanel' as any, 'currentFocus').then((current) => { + if (current === 'etherscan') clientInstance.call('notification' as any, 'toast', 'Please add API key to continue') + }) + } return !apiKey ? (