fix display when no withdraws in funding summary

This commit is contained in:
Barry Gitarts 2019-01-04 16:34:26 -05:00
parent ddda112419
commit d4f63a6b51
2 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ function SimpleCard(props) {
</Typography>
<CardContent className={classes.fundingSummaries}>
<Typography variant="h2">
{Number(deposits) - Number(withdraws)}
{Number(deposits) - Number(withdraws || 0)}
</Typography>
<Typography variant="h5" key={name + 'total'} className={classes.pos} color="textSecondary">
Remaining In Pledges
@ -80,7 +80,7 @@ function SimpleCard(props) {
Funded
</Typography>
<Typography variant="h3">
{withdraws}
{withdraws || 0}
</Typography>
<Typography variant="h6" key={name + 'deposit'} className={classes.pos} color="textSecondary">
Withdrawn

View File

@ -1,6 +1,6 @@
import LPVault from 'Embark/contracts/LPVault'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import StandardToken from 'Embark/contracts/StandardToken'
import SNT from 'Embark/contracts/SNT'
import web3 from 'Embark/web3'
export const initVaultAndLP = async () => {
@ -26,7 +26,7 @@ export const vaultPledgingNeedsInit = async () => {
}
export const standardTokenApproval = async () => {
const { approve } = StandardToken.methods
const { approve } = SNT.methods
const spender = LiquidPledging._address
return await approve(
spender,
@ -35,7 +35,7 @@ export const standardTokenApproval = async () => {
}
export const getLpAllowance = async () => {
const { allowance } = StandardToken.methods
const { allowance } = SNT.methods
const account = await web3.eth.getCoinbase()
const spender = LiquidPledging._address
const allowanceAmt = Number(await allowance(account, spender).call())