Skip to content

Commit 00e7b1e

Browse files
authored
Merge pull request #44737 from bernhardoj/fix/43278-disable-navigating-to-profile-page
Disable navigating to profile page if the user is optimistic
2 parents 35ae731 + 5f3ccd4 commit 00e7b1e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/libs/ReportUtils.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1120,12 +1120,13 @@ function isProcessingReport(report: OnyxEntry<Report>): boolean {
11201120
* and personal detail of participant is optimistic data
11211121
*/
11221122
function shouldDisableDetailPage(report: OnyxEntry<Report>): boolean {
1123-
const participantAccountIDs = Object.keys(report?.participants ?? {}).map(Number);
1124-
11251123
if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report) || isTaskReport(report)) {
11261124
return false;
11271125
}
1128-
if (participantAccountIDs.length === 1) {
1126+
if (isOneOnOneChat(report)) {
1127+
const participantAccountIDs = Object.keys(report?.participants ?? {})
1128+
.map(Number)
1129+
.filter((accountID) => accountID !== currentUserAccountID);
11291130
return isOptimisticPersonalDetail(participantAccountIDs[0]);
11301131
}
11311132
return false;

src/pages/home/report/ReportActionItemCreated.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function ReportActionItemCreated(props: ReportActionItemCreatedProps) {
6868
<OfflineWithFeedback pendingAction={props.report?.pendingFields?.avatar}>
6969
<PressableWithoutFeedback
7070
onPress={() => ReportUtils.navigateToDetailsPage(props.report)}
71-
style={[styles.mh5, styles.mb3, styles.alignSelfStart]}
71+
style={[styles.mh5, styles.mb3, styles.alignSelfStart, shouldDisableDetailPage && styles.cursorDefault]}
7272
accessibilityLabel={translate('common.details')}
7373
role={CONST.ROLE.BUTTON}
7474
disabled={shouldDisableDetailPage}

0 commit comments

Comments
 (0)