Skip to content

Commit 858c604

Browse files
committed
lint
1 parent 2052ddf commit 858c604

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,6 +2928,9 @@ function getInvoiceReceiverIcons(report: OnyxInputOrEntry<Report>, personalDetai
29282928
}
29292929

29302930
const receiverPolicyID = report?.invoiceReceiver?.policyID;
2931+
2932+
// This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
2933+
// eslint-disable-next-line deprecation/deprecation
29312934
const receiverPolicy = invoiceReceiverPolicy ?? getPolicy(receiverPolicyID);
29322935
if (!isEmptyObject(receiverPolicy)) {
29332936
return [
@@ -2946,9 +2949,19 @@ function getInvoiceReceiverIcons(report: OnyxInputOrEntry<Report>, personalDetai
29462949
* Helper function to get the icons for an expense request. Only to be used in getIcons().
29472950
*/
29482951
function getIconsForExpenseRequest(report: OnyxInputOrEntry<Report>, personalDetails: OnyxInputOrEntry<PersonalDetailsList>, policy: OnyxInputOrEntry<Policy>): Icon[] {
2949-
const parentReportAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.parentReportID ?? ''}`]?.[report?.parentReportActionID ?? ''];
2952+
if (!report || !report?.parentReportID || !report?.parentReportActionID) {
2953+
return [];
2954+
}
2955+
const parentReportAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`]?.[report.parentReportActionID];
29502956
const workspaceIcon = getWorkspaceIcon(report, policy);
2951-
const memberIcon = getParticipantIcon(parentReportAction?.actorAccountID, personalDetails, true);
2957+
const actorDetails = parentReportAction?.actorAccountID ? personalDetails?.[parentReportAction.actorAccountID] : undefined;
2958+
const memberIcon = {
2959+
source: actorDetails?.avatar ?? FallbackAvatar,
2960+
id: parentReportAction?.actorAccountID,
2961+
type: CONST.ICON_TYPE_AVATAR,
2962+
name: actorDetails?.displayName ?? '',
2963+
fallbackIcon: actorDetails?.fallbackIcon,
2964+
};
29522965
return [memberIcon, workspaceIcon];
29532966
}
29542967

0 commit comments

Comments
 (0)