diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index cc776bd67a3d..57855ceea3b4 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -593,7 +593,8 @@ function shouldShowLastActorDisplayName(report: OnyxEntry, lastActorDeta reportUtilsIsSelfDM(report) || (isDM(report) && lastActorDetails.accountID !== currentUserAccountID) || lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU || - lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW + (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && + Object.keys(report?.participants ?? {})?.some((participantID) => participantID === CONST.ACCOUNT_ID.MANAGER_MCTEST.toString())) ) { return false; } diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 93e21c94de8d..5f0c8c51484b 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -535,7 +535,9 @@ function getOptionData({ // then try to get that from the last report action if that action is valid // to get data from. let lastActorDetails: Partial | null = lastActorAccountID ? personalDetails?.[lastActorAccountID] ?? null : null; - + if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && lastActorDetails) { + lastActorDetails.accountID = lastAction.actorAccountID; + } if (!lastActorDetails && lastAction) { const lastActorDisplayName = lastAction?.person?.[0]?.text; lastActorDetails = lastActorDisplayName