Page MenuHomePhabricator

[lib] Add a selector for community roots
ClosedPublic

Authored by inka on Nov 14 2022, 6:09 AM.
Tags
None
Referenced Files
F3357056: D5627.id18408.diff
Sat, Nov 23, 10:04 PM
F3357002: D5627.id20305.diff
Sat, Nov 23, 9:49 PM
F3356937: D5627.id20362.diff
Sat, Nov 23, 9:34 PM
Unknown Object (File)
Thu, Nov 14, 10:27 AM
Unknown Object (File)
Fri, Nov 8, 9:58 AM
Unknown Object (File)
Fri, Nov 8, 9:58 AM
Unknown Object (File)
Fri, Nov 8, 9:58 AM
Unknown Object (File)
Fri, Nov 8, 9:58 AM
Subscribers

Details

Summary

Related Linear issue: https://linear.app/comm/issue/ENG-1881/community-navigation-drawer-on-native
Community drawer needs to know which threads are communities. For this reason I created this selector.

Test Plan

Add the following to in native/chat/message-list-container.react.js at the begining of ConnectedMessageListContainer:

const communities = useSelector(communintyThreadSelector);
for (const community of communities) {
  console.log(community.name);
}

and enter a chat. See, that community names are being logged to console (I have an artificially added second community, and both this community and GENESIS get logged).

Diff Detail

Repository
rCOMM Comm
Branch
inka/community_drawer
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Use the return-early pattern

lib/selectors/thread-selectors.js
61 ↗(On Diff #18408)

Typo

inka edited the test plan for this revision. (Show Details)
This comment was removed by inka.
inka requested review of this revision.Nov 14 2022, 6:34 AM
atul retitled this revision from [lib] Add a selector for comminity roots to [lib] Add a selector for community roots.Nov 14 2022, 5:16 PM
This revision is now accepted and ready to land.Nov 15 2022, 3:20 AM