Open platform to collect and prioritize feedback
fix: dont break when voters is 0 (#660)
Guilherme Oenningf9a6b3c44565
diff --git a/app/storage/postgres/post.go b/app/storage/postgres/post.goindex 180e59cae..6cd2b7e89 100644--- a/app/storage/postgres/post.go+++ b/app/storage/postgres/post.go@@ -719,7 +719,7 @@ func (s *PostStorage) ListVotes(post *models.Post, limit int) ([]*models.Vote, esqlLimit = strconv.Itoa(limit)}- var votes []*models.Vote+ votes := []*models.Vote{}err := s.trx.Select(&votes, `SELECTpv.created_at,diff --git a/public/pages/ShowPost/components/VotesPanel.tsx b/public/pages/ShowPost/components/VotesPanel.tsxindex 91fd40c5b..1f8802ff5 100644--- a/public/pages/ShowPost/components/VotesPanel.tsx+++ b/public/pages/ShowPost/components/VotesPanel.tsx@@ -52,11 +52,12 @@ export class VotesPanel extends React.Component<VotesPanelProps, VotesPanelState+{extraVotesCount} more</span>)}- {extraVotesCount === 0 && canShowAll && (+ {this.props.votes.length > 0 && extraVotesCount === 0 && canShowAll && (<span onClick={this.showModal} className={moreVotesClassName}>see details</span>)}+ {this.props.votes.length === 0 && <span className="info">None yet</span>}</div></>);