Skip to content

Commit

Permalink
Liveblocks 1.9.0, filter threads (#4667)
Browse files Browse the repository at this point in the history
* bump liveblocks to 1.9.0

* use the new query param
  • Loading branch information
ruggi authored Dec 20, 2023
1 parent 8a49d3b commit 668f5b7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 40 deletions.
8 changes: 4 additions & 4 deletions editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
"@emotion/serialize": "1.0.2",
"@emotion/styled": "11.0.0",
"@emotion/styled-base": "11.0.0",
"@liveblocks/client": "1.7.1",
"@liveblocks/react": "1.7.1",
"@liveblocks/react-comments": "1.7.1",
"@liveblocks/yjs": "1.7.1",
"@liveblocks/client": "1.9.0",
"@liveblocks/react": "1.9.0",
"@liveblocks/react-comments": "1.9.0",
"@liveblocks/yjs": "1.9.0",
"@popperjs/core": "2.4.4",
"@remix-run/react": "2.0.1",
"@remix-run/server-runtime": "2.3.1",
Expand Down
52 changes: 26 additions & 26 deletions editor/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions editor/src/core/commenting/comment-hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,23 @@ export function useActiveThreads() {
}

export function useResolvedThreads() {
const threads = useThreads()
return {
...threads,
threads: threads.threads.filter((t) => t.metadata.resolved === true),
}
return useThreads({
query: {
metadata: {
resolved: true,
},
},
})
}

export function useUnresolvedThreads() {
const threads = useThreads()
return {
...threads,
threads: threads.threads.filter((t) => t.metadata.resolved !== true),
}
return useThreads({
query: {
metadata: {
resolved: false,
},
},
})
}

export function useSetThreadReadStatusOnMount(thread: ThreadData<ThreadMetadata> | null) {
Expand Down

0 comments on commit 668f5b7

Please sign in to comment.