aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/FeedPage/FeedPage.tsx3
-rw-r--r--src/pages/ProfilePage/ProfilePage.tsx1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/pages/FeedPage/FeedPage.tsx b/src/pages/FeedPage/FeedPage.tsx
index d29103a..b591141 100644
--- a/src/pages/FeedPage/FeedPage.tsx
+++ b/src/pages/FeedPage/FeedPage.tsx
@@ -19,7 +19,8 @@ const FeedPage: React.FC = () => {
const addPoll = (poll: Poll): void => {
polls.unshift(poll);
- setPolls([...polls]);
+ setPolls([]);
+ setPolls(polls);
};
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) => {