From 4a78fc85bc96c7aaf1a46f472d873cd50c674d5f Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 25 May 2023 18:07:39 +0700 Subject: [PATCH] fix error appear for a second when create a task for new member --- src/pages/tasks/NewTaskPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/tasks/NewTaskPage.js b/src/pages/tasks/NewTaskPage.js index d6e13218423d..efeca6b790c8 100644 --- a/src/pages/tasks/NewTaskPage.js +++ b/src/pages/tasks/NewTaskPage.js @@ -15,6 +15,7 @@ import ROUTES from '../../ROUTES'; import TaskSelectorLink from '../../components/TaskSelectorLink'; import reportPropTypes from '../reportPropTypes'; import * as TaskUtils from '../../libs/actions/Task'; +import * as OptionsListUtils from '../../libs/OptionsListUtils'; import FormAlertWithSubmitButton from '../../components/FormAlertWithSubmitButton'; const propTypes = { @@ -76,7 +77,7 @@ const NewTaskPage = (props) => { // If we have an assignee, we want to set the assignee data // If there's an issue with the assignee chosen, we want to notify the user if (props.task.assignee) { - const assigneeDetails = lodashGet(props.personalDetails, props.task.assignee); + const assigneeDetails = lodashGet(OptionsListUtils.getPersonalDetailsForLogins([props.task.assignee], props.personalDetails), props.task.assignee); if (!assigneeDetails) { setSubmitError(true); return setErrorMessage(props.translate('newTaskPage.assigneeError'));