Skip to content

Commit

Permalink
remove particpants from the param
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushu17 committed May 16, 2022
1 parent f590ea6 commit 69e76f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,10 @@ function getReportName(report, personalDetailsForParticipants = {}, policies = {
* Navigate to the details page of a given report
*
* @param {Object} report
* @param {Array} participants
*/
function navigateToDetailsPage(report, participants) {
function navigateToDetailsPage(report) {
const participants = lodashGet(report, 'participants', []);

if (isChatRoom(report) || isPolicyExpenseChat(report)) {
Navigation.navigate(ROUTES.getReportDetailsRoute(report.reportID));
return;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const HeaderView = (props) => {
]}
>
<Pressable
onPress={() => ReportUtils.navigateToDetailsPage(props.report, participants)}
onPress={() => ReportUtils.navigateToDetailsPage(props.report)}
style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}
>
{shouldShowSubscript ? (
Expand Down
4 changes: 1 addition & 3 deletions src/pages/home/report/ReportActionItemCreated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import {Pressable, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import PropTypes from 'prop-types';
import lodashGet from 'lodash/get';
import ONYXKEYS from '../../../ONYXKEYS';
import RoomHeaderAvatars from '../../../components/RoomHeaderAvatars';
import ReportWelcomeText from '../../../components/ReportWelcomeText';
Expand Down Expand Up @@ -36,7 +35,6 @@ const defaultProps = {
};

const ReportActionItemCreated = (props) => {
const participants = lodashGet(props.report, 'participants', []);
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(props.report);
const icons = ReportUtils.getIcons(props.report, props.personalDetails, props.policies);

Expand All @@ -48,7 +46,7 @@ const ReportActionItemCreated = (props) => {
]}
>
<View style={[styles.justifyContentCenter, styles.alignItemsCenter, styles.flex1]}>
<Pressable onPress={() => ReportUtils.navigateToDetailsPage(props.report, participants)}>
<Pressable onPress={() => ReportUtils.navigateToDetailsPage(props.report)}>
<RoomHeaderAvatars
icons={icons}
shouldShowLargeAvatars={isPolicyExpenseChat}
Expand Down

0 comments on commit 69e76f2

Please sign in to comment.