Skip to content

Commit

Permalink
1.38.3: [fix] - Opera Provider Detection (#920)
Browse files Browse the repository at this point in the history
* Switch to browser based detection for Opera

* Increment version

* Remove unused function and formatting

* Use getProviderName now that flag is on provider
  • Loading branch information
lnbc1QWFyb24 authored Jun 1, 2022
1 parent a44404a commit 09f7fc4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/modules/select/wallets/opera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 09f7fc4

Please sign in to comment.