From 53e3d920e78da042f0bbfed15c0f5b2c57e87a43 Mon Sep 17 00:00:00 2001 From: Santiago Siri Date: Fri, 27 Apr 2018 16:30:20 -0400 Subject: [PATCH] backwards compatibility with non tally contracts --- imports/ui/templates/components/decision/ballot/ballot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/ui/templates/components/decision/ballot/ballot.js b/imports/ui/templates/components/decision/ballot/ballot.js index 43ef4ed5d..166cb30eb 100644 --- a/imports/ui/templates/components/decision/ballot/ballot.js +++ b/imports/ui/templates/components/decision/ballot/ballot.js @@ -309,13 +309,13 @@ Template.ballot.helpers({ let label = ''; switch (button) { case 'vote': - if (this.contract.tally.voter.length > 1) { + if (this.contract.tally && this.contract.tally.voter.length > 1) { label = `· ${_.reduce(this.contract.tally.voter, function (memo, voter) { let votes = 0; votes = parseInt(memo.votes + voter.votes, 10); return votes; })}`; - } else if (this.contract.tally.voter.length === 1) { + } else if (this.contract.tally && this.contract.tally.voter.length === 1) { label += `· ${(this.contract.tally.voter[0].votes)}`; } break;