diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-08 09:49:38 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-08 09:49:38 +0300 |
commit | b446a83ff24ed5ea2233c544446557ee29f44364 (patch) | |
tree | 54cf4a3a85c2a2bb7215c0ae10b6ced050242102 /src/pages/ProfilePage/ProfilePage.tsx | |
parent | 6a0b6ec911c39989a1af4322e2a32d75fddbb274 (diff) | |
download | which-ui-b446a83ff24ed5ea2233c544446557ee29f44364.tar.gz |
refactor: use native Route component
Diffstat (limited to 'src/pages/ProfilePage/ProfilePage.tsx')
-rw-r--r-- | src/pages/ProfilePage/ProfilePage.tsx | 7 |
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> |