Skip to content

Commit

Permalink
use the correct report data
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Oct 31, 2023
1 parent 3925722 commit 7caa628
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function OptionRowLHN(props) {
const statusClearAfterDate = lodashGet(optionItem, 'status.clearAfter', '');
const formattedDate = DateUtils.getStatusUntilDate(statusClearAfterDate);
const statusContent = formattedDate ? `${statusText} (${formattedDate})` : statusText;
const isStatusVisible = Permissions.canUseCustomStatus(props.betas) && !!emojiCode && ReportUtils.isOneOnOneChat(optionItem);
const isStatusVisible = Permissions.canUseCustomStatus(props.betas) && !!emojiCode && ReportUtils.isOneOnOneChat(ReportUtils.getReport(optionItem.reportID));

const isGroupChat =
optionItem.type === CONST.REPORT.TYPE.CHAT && _.isEmpty(optionItem.chatType) && !optionItem.isThread && lodashGet(optionItem, 'displayNamesWithTooltips.length', 0) > 2;
Expand Down
7 changes: 3 additions & 4 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,19 +779,17 @@ function isMoneyRequestReport(reportOrID) {
* @returns {boolean}
*/
function isOneOnOneChat(report) {
const isChatRoomValue = lodashGet(report, 'isChatRoom', false);
const participantsListValue = lodashGet(report, 'participantsList', []);
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);
return (
!isThread(report) &&
!isChatRoom(report) &&
!isChatRoomValue &&
!isExpenseRequest(report) &&
!isMoneyRequestReport(report) &&
!isPolicyExpenseChat(report) &&
!isTaskReport(report) &&
isDM(report) &&
!isIOUReport(report) &&
participantsListValue.length === 1
participantAccountIDs.length === 1
);
}

Expand Down Expand Up @@ -2158,6 +2156,7 @@ function getParentNavigationSubtitle(report) {
function navigateToDetailsPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);

console.log('report', report)

Check failure on line 2159 in src/libs/ReportUtils.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
if (isOneOnOneChat(report)) {
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountIDs[0]));
return;
Expand Down

0 comments on commit 7caa628

Please sign in to comment.