aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-07-21 05:18:50 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-07-21 05:23:53 +0800
commit469a79f97ff887eae5ec99cf6be7b19c20972d02 (patch)
treed863732641d56c33bb41ce1ab66eaf6d5056bcbc /ui/app/util.js
parentcb045fd8feec88bd631329ab9b3285aeed0f2e97 (diff)
downloadtangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.tar
tangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.tar.gz
tangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.tar.bz2
tangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.tar.lz
tangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.tar.xz
tangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.tar.zst
tangerine-wallet-browser-469a79f97ff887eae5ec99cf6be7b19c20972d02.zip
Add fallback options for displaying recipient name in the Confirm screen
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index 8c85c5926..8b194e0c7 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -59,6 +59,7 @@ module.exports = {
allNull,
getTokenAddressFromTokenObject,
checksumAddress,
+ addressSlicer,
}
function valuesFor (obj) {
@@ -303,3 +304,11 @@ function getTokenAddressFromTokenObject (token) {
function checksumAddress (address) {
return address ? ethUtil.toChecksumAddress(address) : ''
}
+
+function addressSlicer (address = '') {
+ if (address.length < 11) {
+ return address
+ }
+
+ return `${address.slice(0, 6)}...${address.slice(-4)}`
+}