Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hams7504 committed Oct 16, 2023
1 parent cc10362 commit 4026fd1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/eRACommons.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export const eRACommons = hh(class eRACommons extends React.Component {

componentDidUpdate(prevProps) {
if (this.props.researcherProfile !== prevProps.researcherProfile) {
this.setState({ researcherProfile: this.props.researcherProfile });
this.getUserInfo();
this.setState({ researcherProfile: this.props.researcherProfile }, () => {
this.getUserInfo();
});
}
}

Expand All @@ -57,6 +58,8 @@ export const eRACommons = hh(class eRACommons extends React.Component {

getUserInfo = async () => {
const response = this.props.readOnly ? this.state.researcherProfile : await User.getMe();
// console.log('response:')
// console.log(response)
const props = response.researcherProperties;
const authProp = find({'propertyKey':'eraAuthorized'})(props);
const expProp = find({'propertyKey':'eraExpiration'})(props);
Expand Down Expand Up @@ -133,6 +136,8 @@ export const eRACommons = hh(class eRACommons extends React.Component {
const nihErrorMessage = 'Something went wrong. Please try again.';

return (
// console.log('render:'),
// console.log(this.state.researcherProfile),
div({
className: this.props.className,
style: { minHeight: 65, ...this.props.style }
Expand Down

0 comments on commit 4026fd1

Please sign in to comment.