From 952f1cf8d03c68b83c614508f3b54801949b368d Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 12 Mar 2018 15:22:04 +0100 Subject: Use `isMetaMask` flag rather then constructor name for Metamask provider detection --- packages/website/ts/utils/utils.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'packages/website/ts/utils') 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; }, -- cgit