diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-12-08 03:29:37 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-12-08 03:29:37 +0800 |
commit | b74b4eb053e9e4210dbf507fed88361741ce1d63 (patch) | |
tree | 9c77457f7c82b4e3fffed3e18d54bbc7f8f39db7 /packages/instant/src/util/env.ts | |
parent | 57dc5b6fc086762d9cfedfc8adbfa55adf77fd73 (diff) | |
download | dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.tar dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.tar.gz dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.tar.bz2 dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.tar.lz dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.tar.xz dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.tar.zst dexon-sol-tools-b74b4eb053e9e4210dbf507fed88361741ce1d63.zip |
feat: refactor provider name and displayName logic
Diffstat (limited to 'packages/instant/src/util/env.ts')
-rw-r--r-- | packages/instant/src/util/env.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/instant/src/util/env.ts b/packages/instant/src/util/env.ts index 4a32f9cb1..0fda0cc0e 100644 --- a/packages/instant/src/util/env.ts +++ b/packages/instant/src/util/env.ts @@ -62,4 +62,11 @@ export const envUtil = { } return PROVIDER_TYPE_TO_NAME[providerTypeIfExists]; }, + getProviderDisplayName(provider: Provider): string { + const providerTypeIfExists = envUtil.getProviderType(provider); + if (_.isUndefined(providerTypeIfExists)) { + return 'Wallet'; + } + return PROVIDER_TYPE_TO_NAME[providerTypeIfExists]; + }, }; |