Skip to content

Commit

Permalink
Clean up syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Arend Peter authored and ArendPeter committed Jan 12, 2024
1 parent 0f42a8a commit 26c2937
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Elections/ElectionInvitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default () => {
useEffect(() => {fetchElections()}, []);

const electionInvitations = React.useMemo(
() => data && data.elections_as_voter ? data.elections_as_voter : [],
() => data?.elections_as_voter ? data.elections_as_voter : [],
[data],
);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Elections/ElectionsYouManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default () => {
}

let managedElectionsData = useMemo(() => {
if(data && data.elections_as_official){
if(data?.elections_as_official){
return data.elections_as_official.map(election => ({
...election,
roles: getRoles(election)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Elections/ElectionsYouVotedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default () => {
useEffect(() => {fetchElections()}, []);

const electionInvitations = React.useMemo(
() => data && data.elections_as_voter ? data.elections_as_voter : [],
() => data?.elections_as_voter ? data.elections_as_voter : [],
[data],
);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Elections/OpenElections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default () => {
useEffect(() => {fetchElections()}, []);

let openElectionsData = useMemo(
() => data && data.open_elections ? [...data.open_elections] : [],
() => data?.open_elections ? [...data.open_elections] : [],
[data]
);

Expand Down

0 comments on commit 26c2937

Please sign in to comment.