From f290a59ab231525088653ae577d325f518b99473 Mon Sep 17 00:00:00 2001 From: SrikanthSoparla Date: Fri, 2 Feb 2024 13:09:42 +0530 Subject: [PATCH] vote fixes. --- src/containers/Proposals/Cards.js | 2 +- src/containers/Proposals/ProposalDialog/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/Proposals/Cards.js b/src/containers/Proposals/Cards.js index 5f9bb91..a80444d 100644 --- a/src/containers/Proposals/Cards.js +++ b/src/containers/Proposals/Cards.js @@ -73,7 +73,7 @@ const Cards = (props) => { if (index < (page * rowsPerPage) && index >= (page - 1) * rowsPerPage) { const votedOption = props.voteDetails && props.voteDetails.length && proposal && proposal.id && - props.voteDetails.filter((vote) => vote.id === proposal.id)[0]; + props.voteDetails.filter((vote) => vote && vote.id === proposal.id)[0]; let proposer = proposal.proposer; props.proposalDetails && Object.keys(props.proposalDetails).length && Object.keys(props.proposalDetails).filter((key) => { diff --git a/src/containers/Proposals/ProposalDialog/index.js b/src/containers/Proposals/ProposalDialog/index.js index 4aba443..8e4f647 100644 --- a/src/containers/Proposals/ProposalDialog/index.js +++ b/src/containers/Proposals/ProposalDialog/index.js @@ -110,7 +110,7 @@ class ProposalDialog extends Component { render () { let votedOption = this.props.voteDetails && this.props.voteDetails.length && this.props.proposal && this.props.proposal.id && - this.props.voteDetails.filter((vote) => vote.id === this.props.proposal.id)[0]; + this.props.voteDetails.filter((vote) => vote && vote.id === this.props.proposal.id)[0]; let proposer = this.props.proposal && this.props.proposal.proposer; this.props.proposalDetails && Object.keys(this.props.proposalDetails).length &&