Skip to content

Commit

Permalink
Fix bug when no voters are on the roll
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendPeter committed Jan 8, 2025
1 parent b9cc96a commit b4c5cda
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ViewElectionRolls = () => {
if (flags.isSet('PRECINCTS')) headKeys.push('precinct');

// HACK to detect if they used email
if(data && data.electionRoll && !data.electionRoll[0].email) headKeys.unshift('voter_id')
if(data && data.electionRoll && (data.electionRoll.length == 0 || !data.electionRoll[0].email)) headKeys.unshift('voter_id')

let electionRollData = React.useMemo(
() => data?.electionRoll ? [...data.electionRoll] : [],
Expand Down

0 comments on commit b4c5cda

Please sign in to comment.