New Header edgecase fixes: Close lobby button not shown, disable join button in various places, more... (#12235)

* Add missing tooltip

Signed-off-by: Timo K <toger5@hotmail.de>

* fix incoming call toast (icon + disabled button if there is an ongoing call)

Signed-off-by: Timo K <toger5@hotmail.de>

* room header
 - fix join button not getting disabled if there is an ongoing call
 - fix close lobby button not shown (instead we see the join button)

Signed-off-by: Timo K <toger5@hotmail.de>

* additional tests

Signed-off-by: Timo K <toger5@hotmail.de>

* fix tests

Signed-off-by: Timo K <toger5@hotmail.de>

* update snapshot

Signed-off-by: Timo K <toger5@hotmail.de>

* fix not open menu if disabled

Signed-off-by: Timo K <toger5@hotmail.de>

* add tooltip provider

Signed-off-by: Timo K <toger5@hotmail.de>

* update snap class

Signed-off-by: Timo K <toger5@hotmail.de>

* room header snap update

Signed-off-by: Timo K <toger5@hotmail.de>

* fix snapshot

Signed-off-by: Timo K <toger5@hotmail.de>

---------

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo 2024-02-08 17:48:50 +01:00 committed by GitHub
parent 1c789cbb18
commit 552c65db98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 132 additions and 53 deletions

View file

@ -61,6 +61,7 @@ const enum State {
NoPermission,
Unpinned,
Ongoing,
NotJoined,
}
/**
@ -176,7 +177,7 @@ export const useRoomCall = (
if (activeCalls.find((call) => call.roomId != room.roomId)) {
return State.Ongoing;
}
if (hasGroupCall || hasJitsiWidget || hasManagedHybridWidget) {
if (hasGroupCall && (hasJitsiWidget || hasManagedHybridWidget)) {
return promptPinWidget ? State.Unpinned : State.Ongoing;
}
if (hasLegacyCall) {
@ -243,6 +244,7 @@ export const useRoomCall = (
videoCallDisabledReason = _t("voip|disabled_no_one_here");
break;
case State.Unpinned:
case State.NotJoined:
case State.NoCall:
voiceCallDisabledReason = null;
videoCallDisabledReason = null;

View file

@ -74,14 +74,14 @@ export const useParticipatingMembers = (call: Call): RoomMember[] => {
}, [participants]);
};
export const useFull = (call: Call): boolean => {
export const useFull = (call: Call | null): boolean => {
return (
useParticipantCount(call) >=
(SdkConfig.get("element_call").participant_limit ?? DEFAULTS.element_call.participant_limit!)
);
};
export const useJoinCallButtonDisabledTooltip = (call: Call): string | null => {
export const useJoinCallButtonDisabledTooltip = (call: Call | null): string | null => {
const isFull = useFull(call);
const state = useConnectionState(call);