Skip to content

Commit

Permalink
Merge pull request #45322 from bernhardoj/fix/44040-iou-member-page-i…
Browse files Browse the repository at this point in the history
…s-empty

Fix IOU members page shows empty page
  • Loading branch information
jasperhuangg authored Jul 15, 2024
2 parents 6739683 + 0b0ff5f commit c8aec1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function ReportParticipantsPage({report, personalDetails, session}: ReportPartic
const currentUserAccountID = Number(session?.accountID);
const isCurrentUserAdmin = ReportUtils.isGroupChatAdmin(report, currentUserAccountID);
const isGroupChat = useMemo(() => ReportUtils.isGroupChat(report), [report]);
const isIOUReport = ReportUtils.isIOUReport(report);
const isFocused = useIsFocused();

useEffect(() => {
Expand All @@ -69,7 +70,7 @@ function ReportParticipantsPage({report, personalDetails, session}: ReportPartic

const getUsers = useCallback((): MemberOption[] => {
let result: MemberOption[] = [];
const shouldExcludeHiddenParticipants = !isGroupChat;
const shouldExcludeHiddenParticipants = !isGroupChat && !isIOUReport;
const chatParticipants = ReportUtils.getParticipantsAccountIDsForDisplay(report, shouldExcludeHiddenParticipants);
chatParticipants.forEach((accountID) => {
const role = report.participants?.[accountID].role;
Expand Down Expand Up @@ -112,7 +113,7 @@ function ReportParticipantsPage({report, personalDetails, session}: ReportPartic

result = result.sort((a, b) => (a.text ?? '').toLowerCase().localeCompare((b.text ?? '').toLowerCase()));
return result;
}, [formatPhoneNumber, personalDetails, report, selectedMembers, currentUserAccountID, translate, isGroupChat]);
}, [formatPhoneNumber, personalDetails, report, selectedMembers, currentUserAccountID, translate, isGroupChat, isIOUReport]);

const participants = useMemo(() => getUsers(), [getUsers]);

Expand Down

0 comments on commit c8aec1e

Please sign in to comment.