From 6a5ce334dd3d0bff381f789b52655f7547e13cd5 Mon Sep 17 00:00:00 2001 From: Kheops <26880866+0xKheops@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:09:44 +0900 Subject: [PATCH] fix: always announce eip-6963 (#1103) --- apps/extension/src/core/injectEth/injectEthereum.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/extension/src/core/injectEth/injectEthereum.ts b/apps/extension/src/core/injectEth/injectEthereum.ts index 9ae5d119cc..687419123e 100644 --- a/apps/extension/src/core/injectEth/injectEthereum.ts +++ b/apps/extension/src/core/injectEth/injectEthereum.ts @@ -29,6 +29,9 @@ export const injectEthereum = (sendRequest: SendRequest) => { log.debug("Injecting talismanEth") windowInject.talismanEth = talismanEth + // eip-6963 wallet announcement + announceProvider(talismanEth) + // also inject on window.ethereum if it is not defined // this allows users to just disable metamask if they want to use Talisman instead if (windowInject.ethereum === undefined) { @@ -66,9 +69,6 @@ export const injectEthereum = (sendRequest: SendRequest) => { windowInject.web3 = { currentProvider: talismanEth } window.dispatchEvent(new Event("ethereum#initialized")) - - // eip-6963 wallet announcement - announceProvider(talismanEth) } else if (WITH_LOG_PROXY) { windowInject.ethereum = logProxy(windowInject.ethereum) }