Skip to content

Commit 2d282f2

Browse files
author
Ives van Hoorne
committed
Fix wrong user fetching
1 parent 0ad895b commit 2d282f2

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/app/pages/Profile/index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Profile extends React.PureComponent {
9090
const username = prevProps.match.params.username;
9191

9292
if (username !== this.props.match.params.username && !this.props.user) {
93-
this.fetchUser(username);
93+
this.fetchUser(this.props.match.params.username);
9494
}
9595
}
9696

@@ -121,40 +121,37 @@ class Profile extends React.PureComponent {
121121
<Route
122122
path={match.url}
123123
exact
124-
render={() => (
124+
render={() =>
125125
<Showcase
126126
isCurrentUser={isCurrentUser}
127127
id={user.showcasedSandboxShortid}
128-
/>
129-
)}
128+
/>}
130129
/>
131130
<Route
132131
path={`${profileSandboxesUrl(user.username)}/:page?`}
133132
// eslint-disable-next-line
134-
children={({ match }) => (
133+
children={({ match }) =>
135134
<Sandboxes
136135
username={user.username}
137136
fetchSandboxes={userActions.fetchAllSandboxes}
138137
sandboxes={user.sandboxes}
139138
sandboxCount={user.sandboxCount}
140139
baseUrl={profileSandboxesUrl(user.username)}
141140
page={match.params.page && +match.params.page}
142-
/>
143-
)}
141+
/>}
144142
/>
145143
<Route
146144
path={`${profileLikesUrl(user.username)}/:page?`}
147145
// eslint-disable-next-line
148-
children={({ match }) => (
146+
children={({ match }) =>
149147
<Sandboxes
150148
username={user.username}
151149
fetchSandboxes={userActions.fetchLikedSandboxes}
152150
sandboxes={user.likedSandboxes}
153151
sandboxCount={user.givenLikeCount}
154152
baseUrl={profileLikesUrl(user.username)}
155153
page={match.params.page && +match.params.page}
156-
/>
157-
)}
154+
/>}
158155
/>
159156
</Switch>
160157
</Margin>

0 commit comments

Comments
 (0)