diff options
author | eug-vs <eug-vs@keemail.me> | 2020-07-03 18:20:25 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-07-03 18:20:25 +0300 |
commit | 7fe63f3be94d8711bdfdf714d9a6129318546ef1 (patch) | |
tree | 3a3a42a347760ccdf54dadeb7dfbcfd673f32947 /src/pages/ProfilePage | |
parent | 2e4e67d5789de2fb736becb6b349fc4d2037c385 (diff) | |
download | which-ui-7fe63f3be94d8711bdfdf714d9a6129318546ef1.tar.gz |
feat: update polls when switching between profiles
Diffstat (limited to 'src/pages/ProfilePage')
-rw-r--r-- | src/pages/ProfilePage/ProfilePage.tsx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pages/ProfilePage/ProfilePage.tsx b/src/pages/ProfilePage/ProfilePage.tsx index 2c18466..b7106bb 100644 --- a/src/pages/ProfilePage/ProfilePage.tsx +++ b/src/pages/ProfilePage/ProfilePage.tsx @@ -22,6 +22,7 @@ const ProfilePage: React.FC = () => { setUserInfo(response.data); }); get(`/profiles/${id}`).then(response => { + setPolls([]); setPolls(response.data); setTotalVotes(response.data.reduce( (total: number, current: Poll) => { |