aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/env.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-08 03:29:37 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-12-08 03:29:37 +0800
commitb74b4eb053e9e4210dbf507fed88361741ce1d63 (patch)
tree9c77457f7c82b4e3fffed3e18d54bbc7f8f39db7 /packages/instant/src/util/env.ts
parent57dc5b6fc086762d9cfedfc8adbfa55adf77fd73 (diff)
downloaddexon-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.ts7
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];
+ },
};