diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-03 04:38:02 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-03 07:37:22 +0800 |
commit | 04d11d6fac265d8e43de8c14cab78655bb90d035 (patch) | |
tree | ca60c3dd7899eb3539bd083acc33f3f3cb054931 /packages/website/ts/utils/utils.ts | |
parent | 2eede4a09ecd17cade6623b4a770a62bee57a2e8 (diff) | |
download | dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.tar dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.tar.gz dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.tar.bz2 dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.tar.lz dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.tar.xz dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.tar.zst dexon-sol-tools-04d11d6fac265d8e43de8c14cab78655bb90d035.zip |
Add human readable names for Toshi and Cipher
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 726e1815f..0ef3d6723 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -324,6 +324,7 @@ export const utils = { getProviderType(provider: Provider): Providers | string { const constructorName = provider.constructor.name; let parsedProviderName = constructorName; + // https://ethereum.stackexchange.com/questions/24266/elegant-way-to-detect-current-provider-int-web3-js switch (constructorName) { case 'EthereumProvider': parsedProviderName = Providers.Mist; @@ -337,6 +338,10 @@ export const utils = { parsedProviderName = Providers.Parity; } else if ((provider as any).isMetaMask) { parsedProviderName = Providers.Metamask; + } else if (!_.isUndefined(_.get(window, 'SOFA'))) { + parsedProviderName = Providers.Toshi; + } else if (!_.isUndefined(_.get(window, '__CIPHER__'))) { + parsedProviderName = Providers.Cipher; } return parsedProviderName; }, |