From 37322f9f4ed903ad2556ebb8a278f1a7050eebbd Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Mon, 8 Oct 2018 17:05:57 -0700 Subject: Fix token values being undefined --- ui/app/token-util.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/app/token-util.js') diff --git a/ui/app/token-util.js b/ui/app/token-util.js index 3d61ad1ca..6e4992763 100644 --- a/ui/app/token-util.js +++ b/ui/app/token-util.js @@ -111,3 +111,8 @@ export function calcTokenAmount (value, decimals) { const multiplier = Math.pow(10, Number(decimals || 0)) return new BigNumber(String(value)).div(multiplier).toNumber() } + +export function getTokenValue (tokenParams = []) { + const valueData = tokenParams.find(param => param.name === '_value') + return valueData && valueData.value +} -- cgit v1.2.3