Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix transition of profiles on request confirmation page #27876

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 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,13 @@ function ProfilePage(props) {

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

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

return (
<ScreenWrapper>
<HeaderWithBackButton
Expand Down
Loading