Skip to content

Commit

Permalink
Fix incomplete contributor list for validating multiple tasksin tasks…
Browse files Browse the repository at this point in the history
… comments issue
  • Loading branch information
royallsilwallz committed Nov 2, 2023
1 parent 405e3b0 commit 49ebda1
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions frontend/src/components/taskSelection/actionSidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,19 +586,12 @@ const TaskValidationSelector = ({
// the contributors is filled only on the case of single task validation,
// so we need to fetch the task history in the case of multiple task validation
useEffect(() => {
if (showCommentInput && isValidatingMultipleTasks && !contributors.length) {
if (showCommentInput && isValidatingMultipleTasks) {
fetchLocalJSONAPI(`projects/${projectId}/tasks/${id}/`).then((response) =>
setContributorsList(getTaskContributors(response.taskHistory, userDetails.username)),
);
}
}, [
isValidatingMultipleTasks,
showCommentInput,
contributors,
id,
projectId,
userDetails.username,
]);
}, [isValidatingMultipleTasks, showCommentInput, id, projectId, userDetails.username]);

return (
<div className="cf w-100 db pt1 pv2 blue-dark">
Expand Down Expand Up @@ -650,7 +643,7 @@ const TaskValidationSelector = ({
<CommentInputField
comment={comment}
setComment={setComment}
contributors={contributors.length ? contributors : contributorsList}
contributors={isValidatingMultipleTasks ? contributorsList : contributors}
enableHashtagPaste
enableContributorsHashtag
isShowTabNavs
Expand Down

0 comments on commit 49ebda1

Please sign in to comment.