diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js index aa383e94ecdd..3c6ddefbc32d 100644 --- a/src/libs/actions/Task.js +++ b/src/libs/actions/Task.js @@ -568,10 +568,12 @@ function clearOutTaskInfoAndNavigate(reportID) { /** * Get the assignee data * - * @param {Object} details + * @param {Number} assigneeAccountID + * @param {Object} personalDetails * @returns {Object} */ -function getAssignee(details) { +function getAssignee(assigneeAccountID, personalDetails) { + const details = personalDetails[assigneeAccountID]; if (!details) { return { icons: [], @@ -579,9 +581,8 @@ function getAssignee(details) { subtitle: '', }; } - const source = UserUtils.getAvatar(lodashGet(details, 'avatar', ''), lodashGet(details, 'accountID', -1)); return { - icons: [{source, type: 'avatar', name: details.login}], + icons: ReportUtils.getIconsForParticipants([details.accountID], personalDetails), displayName: details.displayName, subtitle: details.login, }; diff --git a/src/pages/tasks/NewTaskPage.js b/src/pages/tasks/NewTaskPage.js index 3e9cbb4dfdeb..4b1aa0c0101b 100644 --- a/src/pages/tasks/NewTaskPage.js +++ b/src/pages/tasks/NewTaskPage.js @@ -17,7 +17,6 @@ import MenuItemWithTopDescription from '../../components/MenuItemWithTopDescript import MenuItem from '../../components/MenuItem'; import reportPropTypes from '../reportPropTypes'; import * as Task from '../../libs/actions/Task'; -import * as OptionsListUtils from '../../libs/OptionsListUtils'; import * as ReportUtils from '../../libs/ReportUtils'; import FormAlertWithSubmitButton from '../../components/FormAlertWithSubmitButton'; import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; @@ -78,11 +77,7 @@ function 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(OptionsListUtils.getPersonalDetailsForAccountIDs([props.task.assigneeAccountID], props.personalDetails), props.task.assigneeAccountID); - if (!assigneeDetails) { - return setErrorMessage(props.translate('task.assigneeError')); - } - const displayDetails = Task.getAssignee(assigneeDetails); + const displayDetails = Task.getAssignee(props.task.assigneeAccountID, props.personalDetails); setAssignee(displayDetails); }