From 7fe63f3be94d8711bdfdf714d9a6129318546ef1 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Fri, 3 Jul 2020 18:20:25 +0300
Subject: feat: update polls when switching between profiles

---
 src/pages/ProfilePage/ProfilePage.tsx | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src/pages/ProfilePage/ProfilePage.tsx')

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) => {
-- 
cgit v1.2.3

