Skip to content

Commit

Permalink
feat(cases-list-card): only show deadline if you have a pending vote
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Jan 8, 2019
1 parent 1a081f7 commit 928b1a1
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions src/components/cases-list-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,31 @@ const CasesListCard = () => {
if (dispute) {
acc[dispute.period === '4' ? 'executed' : 'active']++
if (dispute.period === '1' || dispute.period === '2') {
const subcourt = call(
const dispute2 = call(
'KlerosLiquid',
'getSubcourt',
dispute.subcourtID
'getDispute',
d.returnValues._disputeID
)
if (subcourt) {
const deadline = new Date(
(Number(dispute.lastPeriodChange) +
Number(subcourt.timesPerPeriod[dispute.period])) *
1000
)
if (!acc.deadline || deadline < acc.deadline)
acc.deadline = deadline
if (dispute2) {
if (
Number(d.returnValues._appeal) ===
dispute2.jurorAtStake.length - 1
) {
const subcourt = call(
'KlerosLiquid',
'getSubcourt',
dispute.subcourtID
)
if (subcourt) {
const deadline = new Date(
(Number(dispute.lastPeriodChange) +
Number(subcourt.timesPerPeriod[dispute.period])) *
1000
)
if (!acc.deadline || deadline < acc.deadline)
acc.deadline = deadline
} else acc.loading = true
}
} else acc.loading = true
}
} else acc.loading = true
Expand Down

0 comments on commit 928b1a1

Please sign in to comment.