-
Notifications
You must be signed in to change notification settings - Fork 155
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
Hide join call button when the user is already in the call #3815
Conversation
This is at the account level so if the user has joined the call on another device, the join button will be hidden. Extract room call state presenter to its own module and update RoomCallState model. Let RoomDetailsPresenter use the new RoomCallStatePresenter
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3815 +/- ##
===========================================
+ Coverage 82.91% 82.93% +0.02%
===========================================
Files 1772 1778 +6
Lines 44534 44620 +86
Branches 5227 5233 +6
===========================================
+ Hits 36924 37005 +81
- Misses 5780 5784 +4
- Partials 1830 1831 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small remarks otherwise LGTM
|
||
import kotlinx.coroutines.flow.StateFlow | ||
|
||
interface CurrentCallObserver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is a bit weird, the observer is the one who subscribe to the flow usually, not the one providing.
I'd call this CurrentCallService or CurrentCallDataSource for exemple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class FakeCurrentCallObserver( | ||
initialValue: CurrentCall = CurrentCall.None, | ||
) : CurrentCallObserver { | ||
override val currentCall = MutableStateFlow(initialValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually when we have StateFlow
we provide them in the constructor of the fake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quality Gate passedIssues Measures |
Content
When the user is in the call due to the Pip mode, the "Join" call button is displayed. This PR hides it if the user is currently (and locally) in the call.
This PR also improve the
RoomCallState
regarding permission. We now have a disabled button if the user is not allowed to join the call.Motivation and context
Closes element-hq/element-meta#2608
Screenshots / GIFs
See the recorded ones.
Tests
Note that if there is a call in another room, joining the other call will do nothing. This is another issue, not related to this PR.
Tested devices
Checklist