Skip to content
Snippets Groups Projects
Commit 3be3ec54 authored by Ulrik Røsby's avatar Ulrik Røsby
Browse files

Merge branch '21-fix-commit-bug' into 'master'

fix: people not being selected when page first opened

Closes #21

See merge request it2810-h21/team-24/project2-it2810!15
parents 68125653 5f3c43f0
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