みてるぞ 2 weeks ago
parent
commit
9d503a3207
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      frontend/src/pages/posts/PostListPage.tsx

+ 4
- 2
frontend/src/pages/posts/PostListPage.tsx View File

@@ -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)


Loading…
Cancel
Save