refactor: remove redundant parent condition in ParentRoom#38724
refactor: remove redundant parent condition in ParentRoom#38724Khizarshah01 wants to merge 6 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughRefactored the conditional logic in the ParentRoom component by removing an intermediate guard around a derived boolean (parentRoomId) and reorganizing the rendering conditions. The component now directly evaluates room.prid and room.teamId conditions without the intermediate computation, maintaining functional equivalence while simplifying the control flow. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
PR is ready for review |
|
/jira COMM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #38724 +/- ##
===========================================
+ Coverage 70.55% 70.59% +0.04%
===========================================
Files 3188 3184 -4
Lines 112651 112523 -128
Branches 20400 20395 -5
===========================================
- Hits 79476 79436 -40
+ Misses 31114 31029 -85
+ Partials 2061 2058 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
Refactors the
ParentRoom.tsxcomponent to remove redundant conditional checks.Currently, the component calculates a parentRoomId boolean by checking
(prid || (teamId && !teamMain))and then immediately checks those same conditions individually again to decide which component to render.Before logic
After logic
This changes simplifies the logic by:
This makes the code cleaner and easier to read and removes the dead code without changing any functionality or behavior.
Steps to test or reproduce
after changes. I tested manually, nothing broke
Further comments
None.
Summary by CodeRabbit
Task: COMM-136