Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Send/SendToken.js
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | const SendToken = ({ tokenId, jestBCH, passLoadingStatus }) => { | ||||
const { getBCH, getRestUrl, sendToken, getTokenStats, burnEtoken } = | const { getBCH, getRestUrl, sendToken, getTokenStats, burnEtoken } = | ||||
useBCH(); | useBCH(); | ||||
// jestBCH is only ever specified for unit tests, otherwise app will use getBCH(); | // jestBCH is only ever specified for unit tests, otherwise app will use getBCH(); | ||||
const BCH = jestBCH ? jestBCH : getBCH(); | const BCH = jestBCH ? jestBCH : getBCH(); | ||||
// Fetch token stats if you do not have them and API did not return an error | // Fetch token stats if you do not have them and API did not return an error | ||||
if (tokenStats === null) { | if (tokenStats === null) { | ||||
getTokenStats(BCH, tokenId).then( | getTokenStats(tokenId).then( | ||||
result => { | result => { | ||||
setTokenStats(result); | setTokenStats(result); | ||||
}, | }, | ||||
err => { | err => { | ||||
console.log(`Error getting token stats: ${err}`); | console.log(`Error getting token stats: ${err}`); | ||||
}, | }, | ||||
); | ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 592 Lines • Show Last 20 Lines |