Page MenuHomePhabricator

[web, native] Introduce and use `ThreadIsChannel` function
ClosedPublic

Authored by jacek on Feb 22 2022, 4:49 AM.
Tags
None
Referenced Files
F3525985: D3261.diff
Mon, Dec 23, 7:04 PM
Unknown Object (File)
Wed, Dec 4, 1:32 AM
Unknown Object (File)
Wed, Dec 4, 1:32 AM
Unknown Object (File)
Wed, Dec 4, 1:31 AM
Unknown Object (File)
Wed, Dec 4, 1:10 AM
Unknown Object (File)
Sun, Nov 24, 2:09 PM
Unknown Object (File)
Sun, Nov 24, 2:08 PM
Unknown Object (File)
Nov 16 2024, 6:25 AM

Details

Summary

Introduce helper function as a follow-up of D3191, that simplifies logic for conditionally displaying Subchannels menu item.

Depends on D3191

Test Plan

Tested web and mobile app. Subchannels menu seems to work in the same way as before.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested changes to this revision.Feb 22 2022, 5:30 AM
tomek added inline comments.
lib/shared/thread-utils.js
146–147 ↗(On Diff #9805)

We should use threadIsChannel here

This revision now requires changes to proceed.Feb 22 2022, 5:30 AM

Used the function following Tomek's suggestion

tomek added inline comments.
lib/shared/thread-utils.js
144 ↗(On Diff #9830)

Both threadInChatList and threadIsChannel return boolean so double negation is not necessary

This revision is now accepted and ready to land.Feb 23 2022, 3:15 AM
This revision now requires review to proceed.Feb 23 2022, 3:15 AM

I think there are several more places where this could be used... for instance, here. To find those places it might be useful to run git grep '== threadTypes.SIDEBAR'. That said, it's probably outside the scope of this diff.

This revision is now accepted and ready to land.Feb 23 2022, 11:23 AM