-
Notifications
You must be signed in to change notification settings - Fork 12.9k
fix: Leave room action available for users without subscription #37477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 4364024 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughFixes the leave room action availability issue by changing the action's visibility logic to check user subscription status instead of a hardcoded joined flag. Updates the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RoomInfo as Room Info View
participant Hook as useRoomLeave Hook
participant API as useUserSubscription
User->>RoomInfo: Opens room information panel
RoomInfo->>Hook: Calls useRoomLeave(room)
Hook->>API: Queries subscription for room._id
alt User has subscription
API-->>Hook: Returns subscription object
Hook->>Hook: canLeave = true
Hook-->>RoomInfo: Returns leave function
RoomInfo->>RoomInfo: Shows Leave button
else User lacks subscription
API-->>Hook: Returns undefined
Hook->>Hook: canLeave = false
Hook-->>RoomInfo: Returns null
RoomInfo->>RoomInfo: Hides Leave button
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37477 +/- ##
===========================================
+ Coverage 68.97% 68.99% +0.02%
===========================================
Files 3358 3358
Lines 114240 114241 +1
Branches 20537 20537
===========================================
+ Hits 78792 78825 +33
+ Misses 33359 33328 -31
+ Partials 2089 2088 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@dougfabris Could you add steps to reproduce to the PR description? |
Proposed changes (including videos or screenshots)
Issue(s)
Closes #35661
Steps to test or reproduce
Further comments
CORE-1534
Summary by CodeRabbit