Skip to content

Commit

Permalink
Merge pull request Expensify#30694 from pradeepmdk/fix/29165-clean-do…
Browse files Browse the repository at this point in the history
…uble-onyx

remove double onyx in profile page
  • Loading branch information
techievivek authored Nov 8, 2023
2 parents 73627cf + 073530c commit 093d55b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/pages/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const getPhoneNumber = (details) => {

function ProfilePage(props) {
const accountID = Number(lodashGet(props.route.params, 'accountID', 0));

const details = lodashGet(props.personalDetails, accountID, ValidationUtils.isValidAccountRoute(accountID) ? {} : {isloading: false});

const displayName = details.displayName ? details.displayName : props.translate('common.hidden');
Expand Down Expand Up @@ -298,14 +297,11 @@ export default compose(
session: {
key: ONYXKEYS.SESSION,
},
}),
// eslint-disable-next-line rulesdir/no-multiple-onyx-in-file
withOnyx({
report: {
key: ({route, session}) => {
const accountID = Number(lodashGet(route.params, 'accountID', 0));
const reportID = lodashGet(ReportUtils.getChatByParticipants([accountID]), 'reportID', '');
if (Number(session.accountID) === accountID || Session.isAnonymousUser() || !reportID) {
if ((session && Number(session.accountID) === accountID) || Session.isAnonymousUser() || !reportID) {
return null;
}
return `${ONYXKEYS.COLLECTION.REPORT}${reportID}`;
Expand Down

0 comments on commit 093d55b

Please sign in to comment.