@@ -6,7 +6,6 @@ import type {OnyxEntry} from 'react-native-onyx';
6
6
import Checkbox from '@components/Checkbox' ;
7
7
import Icon from '@components/Icon' ;
8
8
import * as Expensicons from '@components/Icon/Expensicons' ;
9
- import { usePersonalDetails } from '@components/OnyxProvider' ;
10
9
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback' ;
11
10
import RenderHTML from '@components/RenderHTML' ;
12
11
import { showContextMenuForReport } from '@components/ShowContextMenuContext' ;
@@ -18,7 +17,6 @@ import useThemeStyles from '@hooks/useThemeStyles';
18
17
import ControlSelection from '@libs/ControlSelection' ;
19
18
import * as DeviceCapabilities from '@libs/DeviceCapabilities' ;
20
19
import getButtonState from '@libs/getButtonState' ;
21
- import * as LocalePhoneNumber from '@libs/LocalePhoneNumber' ;
22
20
import Navigation from '@libs/Navigation/Navigation' ;
23
21
import * as ReportUtils from '@libs/ReportUtils' ;
24
22
import * as TaskUtils from '@libs/TaskUtils' ;
@@ -65,7 +63,6 @@ type TaskPreviewProps = WithCurrentUserPersonalDetailsProps &
65
63
function TaskPreview ( { taskReport, taskReportID, action, contextMenuAnchor, chatReportID, checkIfContextMenuActive, currentUserPersonalDetails, isHovered = false } : TaskPreviewProps ) {
66
64
const styles = useThemeStyles ( ) ;
67
65
const StyleUtils = useStyleUtils ( ) ;
68
- const personalDetails = usePersonalDetails ( ) || CONST . EMPTY_OBJECT ;
69
66
const { translate} = useLocalize ( ) ;
70
67
71
68
// The reportAction might not contain details regarding the taskReport
@@ -76,13 +73,8 @@ function TaskPreview({taskReport, taskReportID, action, contextMenuAnchor, chatR
76
73
: action ?. childStateNum === CONST . REPORT . STATE_NUM . APPROVED && action ?. childStatusNum === CONST . REPORT . STATUS_NUM . APPROVED ;
77
74
const taskTitle = Str . htmlEncode ( TaskUtils . getTaskTitle ( taskReportID , action ?. childReportName ?? '' ) ) ;
78
75
const taskAssigneeAccountID = Task . getTaskAssigneeAccountID ( taskReport ) ?? action ?. childManagerAccountID ?? '' ;
79
- const assigneeLogin = personalDetails [ taskAssigneeAccountID ] ?. login ?? '' ;
80
- const assigneeDisplayName = personalDetails [ taskAssigneeAccountID ] ?. displayName ?? '' ;
81
- const taskAssignee = assigneeDisplayName || LocalePhoneNumber . formatPhoneNumber ( assigneeLogin ) ;
82
76
const htmlForTaskPreview =
83
- taskAssignee && taskAssigneeAccountID !== 0
84
- ? `<comment><mention-user accountid="${ taskAssigneeAccountID } ">@${ taskAssignee } </mention-user> ${ taskTitle } </comment>`
85
- : `<comment>${ taskTitle } </comment>` ;
77
+ taskAssigneeAccountID !== 0 ? `<comment><mention-user accountid="${ taskAssigneeAccountID } "></mention-user> ${ taskTitle } </comment>` : `<comment>${ taskTitle } </comment>` ;
86
78
const isDeletedParentAction = ReportUtils . isCanceledTaskReport ( taskReport , action ) ;
87
79
88
80
if ( isDeletedParentAction ) {
0 commit comments