From 073530cc61aa7a019a76ec56a70525bc6ee9fb58 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Wed, 1 Nov 2023 18:17:44 +0530 Subject: [PATCH] remove doble onyx --- src/pages/ProfilePage.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pages/ProfilePage.js b/src/pages/ProfilePage.js index e97975b0481b..6b851bf9e5b2 100755 --- a/src/pages/ProfilePage.js +++ b/src/pages/ProfilePage.js @@ -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'); @@ -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}`;