aboutsummaryrefslogtreecommitdiff
path: root/src/pages/ProfilePage
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-07-03 18:20:25 +0300
committereug-vs <eug-vs@keemail.me>2020-07-03 18:20:25 +0300
commit7fe63f3be94d8711bdfdf714d9a6129318546ef1 (patch)
tree3a3a42a347760ccdf54dadeb7dfbcfd673f32947 /src/pages/ProfilePage
parent2e4e67d5789de2fb736becb6b349fc4d2037c385 (diff)
downloadwhich-ui-7fe63f3be94d8711bdfdf714d9a6129318546ef1.tar.gz
feat: update polls when switching between profiles
Diffstat (limited to 'src/pages/ProfilePage')
-rw-r--r--src/pages/ProfilePage/ProfilePage.tsx1
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) => {