Skip to content

Commit

Permalink
fix transition of profiles on request confirmation page
Browse files Browse the repository at this point in the history
  • Loading branch information
b4s36t4 committed Sep 20, 2023
1 parent d00a4d6 commit 8b438b5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/pages/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ const getPhoneNumber = (details) => {
function ProfilePage(props) {
const accountID = Number(lodashGet(props.route.params, 'accountID', 0));

// eslint-disable-next-line rulesdir/prefer-early-return
useEffect(() => {
if (ValidationUtils.isValidAccountRoute(accountID)) {
PersonalDetails.openPublicProfilePage(accountID);
}
}, [accountID]);

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 @@ -143,6 +136,12 @@ function ProfilePage(props) {

const chatReportWithCurrentUser = !isCurrentUser && !Session.isAnonymousUser() ? ReportUtils.getChatByParticipants([accountID]) : 0;

useEffect(() => {
if (ValidationUtils.isValidAccountRoute(accountID) && !hasMinimumDetails) {
PersonalDetails.openPublicProfilePage(accountID);
}
}, [accountID, hasMinimumDetails]);

return (
<ScreenWrapper>
<HeaderWithBackButton
Expand Down

0 comments on commit 8b438b5

Please sign in to comment.