Skip to content

Commit fd791b0

Browse files
chore: refactor the code (#443)
1 parent 12ec36c commit fd791b0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/providers/onekey-eth-provider/src/registerEIP6963Provider.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ export function registerEIP6963Provider({
5151
image: string;
5252
provider: ProviderEthereum;
5353
}) {
54-
if (
55-
uuid === METAMASK_UUID &&
56-
!METAMASK_OVERRIDE_HOSTNAMES.includes(window.location.hostname) &&
57-
!detectPrivySDK()
58-
) {
59-
return;
54+
if (uuid === METAMASK_UUID) {
55+
const allowed: boolean =
56+
METAMASK_OVERRIDE_HOSTNAMES.includes(window.location.hostname) || detectPrivySDK();
57+
if (!allowed) return;
6058
}
6159

6260
// EIP-6963: https://eips.ethereum.org/EIPS/eip-6963

0 commit comments

Comments
 (0)