Skip to content
Snippets Groups Projects
Commit 5f3c43f0 authored by Espen Boman Fosseide's avatar Espen Boman Fosseide :dart:
Browse files

fix: people not being selected when page first opened

parent 68125653
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,9 @@ export default function FeatsVsFixesPage() { ...@@ -39,7 +39,9 @@ export default function FeatsVsFixesPage() {
useEffect(() => { useEffect(() => {
getAllCommitsFromAPI().then((res) => { getAllCommitsFromAPI().then((res) => {
if (res) { if (res) {
setAuthorData(parseCommitData(res)); const parsedData = parseCommitData(res);
setAuthorData(parsedData);
if (!selectedAuthors.length) setSelectedAuthors(new Array(parsedData.length).fill(true));
} }
}); });
}, []); }, []);
...@@ -57,7 +59,7 @@ export default function FeatsVsFixesPage() { ...@@ -57,7 +59,7 @@ export default function FeatsVsFixesPage() {
Person {i + 1} Person {i + 1}
<Checkbox <Checkbox
className={classes.checkbox} className={classes.checkbox}
checked={selectedAuthors[i]} checked={selectedAuthors[i] || false}
onChange={() => { onChange={() => {
if (!selectedAuthors) return; // selectedAuthors will never be undefined if (!selectedAuthors) return; // selectedAuthors will never be undefined
const tempList = [...selectedAuthors]; const tempList = [...selectedAuthors];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment