diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-12 22:22:04 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-12 22:22:04 +0800 |
commit | 952f1cf8d03c68b83c614508f3b54801949b368d (patch) | |
tree | ddade5109e9eac15e8dc0399b224a7ae5d8102fb /packages | |
parent | 86a55fe55a8abc0560ef183ea017d3703d9bb9a4 (diff) | |
download | dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar.gz dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar.zst dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.zip |
Use `isMetaMask` flag rather then constructor name for Metamask provider detection
Diffstat (limited to 'packages')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 5fcd3f8e5..abb2598c3 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -281,10 +281,6 @@ export const utils = { const constructorName = provider.constructor.name; let parsedProviderName = constructorName; switch (constructorName) { - case 'MetamaskInpageProvider': - parsedProviderName = Providers.Metamask; - break; - case 'EthereumProvider': parsedProviderName = Providers.Mist; break; @@ -295,6 +291,8 @@ export const utils = { } if ((provider as any).isParity) { parsedProviderName = Providers.Parity; + } else if ((provider as any).isMetaMask) { + parsedProviderName = Providers.Metamask; } return parsedProviderName; }, |