Page MenuHomePhabricator

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

Authored by jacek on Feb 22 2022, 4:49 AM.
Tags
None
Referenced Files
F3274031: D3261.id9805.diff
Sat, Nov 16, 6:25 AM
F3273977: D3261.id10008.diff
Sat, Nov 16, 6:24 AM
Unknown Object (File)
Wed, Nov 13, 12:32 PM
Unknown Object (File)
Sat, Nov 2, 6:37 AM
Unknown Object (File)
Sat, Nov 2, 6:37 AM
Unknown Object (File)
Sat, Nov 2, 6:37 AM
Unknown Object (File)
Sat, Nov 2, 6:36 AM
Unknown Object (File)
Sat, Nov 2, 6:35 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
Branch
jacek/subchannel-logic
Lint
No Lint Coverage
Unit
No Test Coverage

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

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