Skip to content

Commit 39f3cf4

Browse files
authored
Merge pull request Expensify#64204 from samranahm/62131/inconsistent-last-actor
fix: last actor display name not update on actionableMentionWhisper
2 parents cec17ac + de0bbdf commit 39f3cf4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/libs/OptionsListUtils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ import {
9494
isTaskAction,
9595
isThreadParentMessage,
9696
isUnapprovedAction,
97-
isWhisperAction,
9897
shouldReportActionBeVisible,
9998
} from './ReportActionsUtils';
10099
import type {OptionData} from './ReportUtils';
@@ -428,7 +427,6 @@ Onyx.connect({
428427
const reportActionsForDisplay = sortedReportActions.filter(
429428
(reportAction, actionKey) =>
430429
shouldReportActionBeVisible(reportAction, actionKey, isWriteActionAllowed) &&
431-
!isWhisperAction(reportAction) &&
432430
reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED &&
433431
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
434432
);
@@ -964,7 +962,7 @@ function createOption(accountIDs: number[], personalDetails: OnyxInputOrEntry<Pe
964962
const lastAction = lastVisibleReportActions[report.reportID];
965963
// lastActorAccountID can be an empty string
966964
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
967-
const lastActorAccountID = report.lastActorAccountID || lastAction?.actorAccountID;
965+
const lastActorAccountID = lastAction?.actorAccountID || report.lastActorAccountID;
968966
const lastActorDetails = lastActorAccountID ? (personalDetails?.[lastActorAccountID] ?? null) : null;
969967
const lastActorDisplayName = getLastActorDisplayName(lastActorDetails);
970968
const lastMessageTextFromReport = getLastMessageTextForReport(report, lastActorDetails, undefined, !!result.private_isArchived);

src/libs/ReportActionsUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ function shouldReportActionBeVisibleAsLastAction(reportAction: OnyxInputOrEntry<
875875
// If the action's message text is empty and it is not a deleted parent with visible child actions, hide it. Else, consider the action to be displayable.
876876
return (
877877
shouldReportActionBeVisible(reportAction, reportAction.reportActionID, canUserPerformWriteAction) &&
878-
!(isWhisperAction(reportAction) && !isReportPreviewAction(reportAction) && !isMoneyRequestAction(reportAction)) &&
878+
(!(isWhisperAction(reportAction) && !isReportPreviewAction(reportAction) && !isMoneyRequestAction(reportAction)) || isActionableMentionWhisper(reportAction)) &&
879879
!(isDeletedAction(reportAction) && !isDeletedParentAction(reportAction))
880880
);
881881
}

src/libs/SidebarUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ function getOptionData({
624624
const lastAction = visibleReportActionItems[report.reportID];
625625
// lastActorAccountID can be an empty string
626626
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
627-
const lastActorAccountID = report.lastActorAccountID || lastAction?.actorAccountID;
627+
const lastActorAccountID = lastAction?.actorAccountID || report.lastActorAccountID;
628628
// If the last actor's details are not currently saved in Onyx Collection,
629629
// then try to get that from the last report action if that action is valid
630630
// to get data from.

0 commit comments

Comments
 (0)