aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-12 22:22:04 +0800
committerFabio Berger <me@fabioberger.com>2018-03-12 22:22:04 +0800
commit952f1cf8d03c68b83c614508f3b54801949b368d (patch)
treeddade5109e9eac15e8dc0399b224a7ae5d8102fb /packages
parent86a55fe55a8abc0560ef183ea017d3703d9bb9a4 (diff)
downloaddexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar
dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar.gz
dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar.bz2
dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar.lz
dexon-sol-tools-952f1cf8d03c68b83c614508f3b54801949b368d.tar.xz
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.ts6
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;
},