Skip to content

Commit

Permalink
check currentUser with accountID in DetailsPage
Browse files Browse the repository at this point in the history
  • Loading branch information
c3024 committed Oct 9, 2023
1 parent 402548b commit c01b4be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/DetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const propTypes = {

/** Session info for the currently logged in user. */
session: PropTypes.shape({
/** Currently logged in user email */
email: PropTypes.string,
/** Currently logged in user accountID */
accountID: PropTypes.number,
}),

...withLocalizePropTypes,
Expand All @@ -61,7 +61,7 @@ const defaultProps = {
// When opening someone else's profile (via deep link) before login, this is empty
personalDetails: {},
session: {
email: '',
accountID: 0,
},
};

Expand Down Expand Up @@ -122,7 +122,7 @@ function DetailsPage(props) {
const phoneNumber = getPhoneNumber(details);
const phoneOrEmail = isSMSLogin ? getPhoneNumber(details) : details.login;

const isCurrentUser = props.session.email === login.toLowerCase();
const isCurrentUser = props.session.accountID === details.accountID;

return (
<ScreenWrapper testID={DetailsPage.displayName}>
Expand Down

0 comments on commit c01b4be

Please sign in to comment.