Skip to content

Commit

Permalink
added changes per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed Feb 11, 2024
1 parent 49d6883 commit 85d1991
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,8 @@ function getActionableMentionWhisperMessage(reportAction: OnyxEntry<ReportAction
const personalDetails = PersonalDetailsUtils.getPersonalDetailsByIDs(targetAccountIDs, 0);
const mentionElements = targetAccountIDs.map((accountID): string => {
const personalDetail = personalDetails.find((personal) => personal.accountID === accountID);
const handleText = PersonalDetailsUtils.getEffectiveDisplayName(personalDetail) ?? Localize.translateLocal('common.hidden');
const displayName = PersonalDetailsUtils.getEffectiveDisplayName(personalDetail);
const handleText = _.isEmpty(displayName) ? Localize.translateLocal('common.hidden') : displayName;
return `<mention-user accountID=${accountID}>@${handleText}</mention-user>`;
});
const preMentionsText = 'Heads up, ';
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ function ReportActionItem(props) {
[props.draftMessage, props.action, props.report.reportID, toggleContextMenuFromActiveReportAction, originalReport, originalReportID],
);

// Handles manual scrolling to the bottom of the chat when the last message is an actionable mention whisper and it's resolved.
// This fixes an issue where InvertedFlatList fails to auto scroll down and results in an empty space at the bottom of the chat in IOS.
useEffect(() => {
if (props.index !== 0 || !ReportActionsUtils.isActionableMentionWhisper(props.action)) {
return;
Expand Down

0 comments on commit 85d1991

Please sign in to comment.