diff --git a/frontend/src/pages/posts/PostListPage.tsx b/frontend/src/pages/posts/PostListPage.tsx index a375014..8093aeb 100644 --- a/frontend/src/pages/posts/PostListPage.tsx +++ b/frontend/src/pages/posts/PostListPage.tsx @@ -35,7 +35,10 @@ export default () => { ...(withCursor && { cursor }) } }) const data = toCamel (res.data as any, { deep: true }) as { posts: Post[] nextCursor: string } - setPosts (posts => [...(withCursor ? posts : []), ...data.posts]) + setPosts (posts => ( + [...((new Map ([...(withCursor ? posts : []), ...data.posts] + .map (post => [post.id, post]))) + .values ())])) setCursor (data.nextCursor) setLoading (false) @@ -79,7 +82,6 @@ export default () => { setPosts ([]) loadMore (false) } - sessionStorage.removeItem ('posts') setWikiPage (null) if (tags.length === 1)