aboutsummaryrefslogtreecommitdiff
path: root/src/pages/ProfilePage/ProfilePage.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-08-08 09:49:38 +0300
committereug-vs <eug-vs@keemail.me>2020-08-08 09:49:38 +0300
commitb446a83ff24ed5ea2233c544446557ee29f44364 (patch)
tree54cf4a3a85c2a2bb7215c0ae10b6ced050242102 /src/pages/ProfilePage/ProfilePage.tsx
parent6a0b6ec911c39989a1af4322e2a32d75fddbb274 (diff)
downloadwhich-ui-b446a83ff24ed5ea2233c544446557ee29f44364.tar.gz
refactor: use native Route component
Diffstat (limited to 'src/pages/ProfilePage/ProfilePage.tsx')
-rw-r--r--src/pages/ProfilePage/ProfilePage.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pages/ProfilePage/ProfilePage.tsx b/src/pages/ProfilePage/ProfilePage.tsx
index b81c70f..ae94b9f 100644
--- a/src/pages/ProfilePage/ProfilePage.tsx
+++ b/src/pages/ProfilePage/ProfilePage.tsx
@@ -29,12 +29,11 @@ const ProfilePage: React.FC = () => {
if (username) {
get(`/users?username=${username}`).then(response => {
- if (!response.data.length) return redirect(); // TODO: handle this case
+ if (!response.data.length) redirect(); // TODO: handle this case
setUserInfo(response.data[0]);
setIsInfoLoading(false);
}).catch(() => redirect());
- } else redirect()
-
+ } else redirect();
}, [username, user, history]);
@@ -54,7 +53,7 @@ const ProfilePage: React.FC = () => {
));
});
}
- }, [userInfo])
+ }, [userInfo]);
return (
<Container maxWidth="sm" disableGutters>