chore(utils): fix truncate address

This commit is contained in:
George Lima 2019-02-11 10:51:16 -03:00
parent 1757398b36
commit be3d3d38c7
1 changed files with 3 additions and 5 deletions

View File

@ -1,6 +1,4 @@
// @flow
export const truncateAddress = (address: string = '') => `${address.substr(0, 20)}...${address.substr(
address.length - 10,
address.length,
)}`;
export const truncateAddress = (address: string = '') => (address.length < 20
? address
: `${address.substr(0, 20)}...${address.substr(address.length - 10, address.length)}`);