Skip to content

Commit

Permalink
feat(case-details-card): current ruling
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Mar 2, 2019
1 parent 85e7704 commit 11e2592
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/case-details-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const CaseDetailsCard = ({ ID }) => {
)
const votesData = useCacheCall(['KlerosLiquid'], call => {
let votesData = { loading: true }
const currentRuling = call('KlerosLiquid', 'currentRuling', ID)
if (draws) {
const vote = call(
'KlerosLiquid',
Expand All @@ -207,7 +208,8 @@ const CaseDetailsCard = ({ ID }) => {
Number(draws[draws.length - 1].returnValues._appeal) ===
dispute2.votesLengths.length - 1 &&
dispute.period === '2',
loading: false,
currentRuling,
loading: !currentRuling,
voteIDs: [],
voted: vote.voted && vote.choice
}
Expand Down Expand Up @@ -310,6 +312,10 @@ const CaseDetailsCard = ({ ID }) => {
: dispute.period === '0'
? 'Waiting for evidence.'
: 'You did not cast a vote.'}
{dispute.period === '4' &&
` The winning choice was "${metaEvidence.metaEvidenceJSON
.rulingOptions.titles[votesData.currentRuling - 1] ||
'Refuse to Arbitrate'}".`}
{votesData.canVote && (
<StyledInputTextArea
onChange={onJustificationChange}
Expand Down

0 comments on commit 11e2592

Please sign in to comment.