From 09f7fc487c26f12fdb2b937043ef37f430436517 Mon Sep 17 00:00:00 2001 From: Aaron Barnard Date: Wed, 1 Jun 2022 10:24:26 +1000 Subject: [PATCH] 1.38.3: [fix] - Opera Provider Detection (#920) * Switch to browser based detection for Opera * Increment version * Remove unused function and formatting * Use getProviderName now that flag is on provider --- src/modules/select/wallets/opera.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/modules/select/wallets/opera.ts b/src/modules/select/wallets/opera.ts index b8f955ac7..9e697146b 100644 --- a/src/modules/select/wallets/opera.ts +++ b/src/modules/select/wallets/opera.ts @@ -3,6 +3,7 @@ import { WalletModule, Helpers, CommonWalletOptions } from '../../../interfaces' import operaIcon from '../wallet-icons/icon-opera.png' import operaIcon2x from '../wallet-icons/icon-opera@2x.png' +import { getProviderName } from '../../../utilities' function opera(options: CommonWalletOptions): WalletModule { const { preferred, label, iconSrc, svg } = options @@ -13,16 +14,13 @@ function opera(options: CommonWalletOptions): WalletModule { iconSrcSet: iconSrc || operaIcon2x, svg, wallet: async (helpers: Helpers) => { - const { getProviderName, createModernProviderInterface } = helpers - - const provider = - (window as any).ethereum || - ((window as any).web3 && (window as any).web3.currentProvider) + const { createModernProviderInterface, browser } = helpers + const provider = (window as any).ethereum return { provider, interface: - provider && getProviderName(provider) === undefined + provider && getProviderName(provider) === 'Opera' ? createModernProviderInterface(provider) : null }