Skip to content

Commit d851249

Browse files
author
Ives van Hoorne
committed
Fix user refetching
1 parent 3f69f50 commit d851249

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/app/pages/Profile/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ class Profile extends React.PureComponent {
8686
this.fetchUser(username);
8787
}
8888

89+
componentDidUpdate(prevProps: Props) {
90+
const username = prevProps.match.params.username;
91+
92+
if (username !== this.props.match.params.username && !this.props.user) {
93+
this.fetchUser(username);
94+
}
95+
}
96+
8997
render() {
9098
if (this.state.notFound) {
9199
return <NotFound />;

0 commit comments

Comments
 (0)