mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-02-16 21:36:46 +00:00
do not calc date if no fundProfile
This commit is contained in:
parent
a2143d5b84
commit
6b76e98e78
@ -16,7 +16,7 @@ const convertToDatetime = (field, fundProfiles) => {
|
||||
const { commitTime, id } = field
|
||||
const profile = fundProfiles[id - 1]
|
||||
//TODO fix - add commitTime from funder and delegates to get actual dateTime
|
||||
if (Number(commitTime) === 0) return 0
|
||||
if (!profile || Number(commitTime) === 0) return 0
|
||||
const time = Number(commitTime) + Number(profile.commitTime)
|
||||
const date = new Date(time * 1000)
|
||||
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`
|
||||
|
@ -17,26 +17,27 @@ const { transfer } = LiquidPledgingMock.methods
|
||||
const TransferDialog = ({ row, handleClose, transferPledgeAmounts }) => (
|
||||
<Formik
|
||||
initialValues={{}}
|
||||
onSubmit={async (values, { setSubmitting, resetForm, setStatus }) => {
|
||||
const { id } = row
|
||||
const { idSender, amount, idReceiver } = values
|
||||
const args = [idSender, id, toWei(amount.toString()), idReceiver]
|
||||
|
||||
const toSend = transfer(...args);
|
||||
const estimatedGas = await toSend.estimateGas();
|
||||
|
||||
toSend.send({gas: estimatedGas + 1000})
|
||||
.then(res => {
|
||||
console.log({res})
|
||||
const { events: { Transfer: { returnValues } } } = res
|
||||
transferPledgeAmounts(returnValues)
|
||||
handleClose()
|
||||
})
|
||||
.catch(e => {
|
||||
console.log({e})
|
||||
})
|
||||
.finally(() => { resetForm() })
|
||||
}}
|
||||
onSubmit={async (values, { setSubmitting, resetForm, setStatus }) => {
|
||||
const { id } = row
|
||||
const { idSender, amount, idReceiver } = values
|
||||
const args = [idSender, id, toWei(amount.toString()), idReceiver]
|
||||
const toSend = transfer(...args);
|
||||
const estimatedGas = await toSend.estimateGas();
|
||||
|
||||
toSend.send({gas: estimatedGas + 1000})
|
||||
.then(res => {
|
||||
console.log({res})
|
||||
const { events: { Transfer: { returnValues } } } = res
|
||||
transferPledgeAmounts(returnValues)
|
||||
})
|
||||
.catch(e => {
|
||||
console.log({e})
|
||||
})
|
||||
.finally(() => {
|
||||
handleClose()
|
||||
resetForm()
|
||||
})
|
||||
}}
|
||||
>
|
||||
{({
|
||||
values,
|
||||
|
Loading…
x
Reference in New Issue
Block a user