HomePhabricator
Diffusion Comm 931f3491dd4b

[lib] Introduce `useThreadsInChatList` and consume in `useFilteredChildThreads`

Description

[lib] Introduce useThreadsInChatList and consume in useFilteredChildThreads

Summary:
We want to replace usages of threadInChatList with the useThreadInChatList hook. However, similar to what we ran into with D11924, there are situations where we need to do the check on a list of ThreadInfos instead of a single one. We can't use the useThreadInChatList hook within a for-loop or .filter() block, so we need to introduce a new hook which handles the iteration "inside." Thankfully, we can consume useThreadsWithPermission within useThreadsInChatList so we can reuse that existing logic.


Depends on D11925

Test Plan:
flow and close reading

Add log statements to useFilteredChildThreads and ensure return value of threadInChatList and useThreadsInChatList are identical.

Reviewers: ashoat, ginsu, tomek, varun, will

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D11950

Details

Provenance
atulAuthored on May 8 2024, 6:37 PM
Reviewer
tomek
Differential Revision
D11950: [lib] Introduce `useThreadsInChatList` and consume in `useFilteredChildThreads`
Parents
rCOMM6746dbe0c7f1: [terraform] set all rust services to debug on staging
Branches
Unknown
Tags
Unknown