Remove NoOneHere disabled reason. (#30524)
* Remove NoOneHere disabled reason. This was used to prohibit starting calls if the user is alone in the room. Since there are currently issues with the user count calculation this can disable the button even when not appropriate. On top of that, there is a reason to start a call if the room was just created and the user is still waiting for the others to join the room to then join the call. Signed-off-by: Timo K <toger5@hotmail.de> * some ci fixes Signed-off-by: Timo K <toger5@hotmail.de> * fix test snapshots Signed-off-by: Timo K <toger5@hotmail.de> * fix test to expect enabled call buttons * Update snapshot for unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx --------- Signed-off-by: Timo K <toger5@hotmail.de> Co-authored-by: fkwp <github-fkwp@w4ve.de>
This commit is contained in:
@@ -32,7 +32,6 @@ import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"
|
||||
import { Action } from "../../dispatcher/actions";
|
||||
import { CallStore, CallStoreEvent } from "../../stores/CallStore";
|
||||
import { isVideoRoom } from "../../utils/video-rooms";
|
||||
import { useGuestAccessInformation } from "./useGuestAccessInformation";
|
||||
import { UIFeature } from "../../settings/UIFeature";
|
||||
import { BetaPill } from "../../components/views/beta/BetaCard";
|
||||
import { type InteractionName } from "../../PosthogTrackers";
|
||||
@@ -73,7 +72,6 @@ export const getPlatformCallTypeProps = (
|
||||
|
||||
const enum State {
|
||||
NoCall,
|
||||
NoOneHere,
|
||||
NoPermission,
|
||||
Unpinned,
|
||||
Ongoing,
|
||||
@@ -197,7 +195,6 @@ export const useRoomCall = (
|
||||
const connectedCalls = useEventEmitterState(CallStore.instance, CallStoreEvent.ConnectedCalls, () =>
|
||||
Array.from(CallStore.instance.connectedCalls),
|
||||
);
|
||||
const { canInviteGuests } = useGuestAccessInformation(room);
|
||||
|
||||
const state = useMemo((): State => {
|
||||
if (connectedCalls.find((call) => call.roomId != room.roomId)) {
|
||||
@@ -209,9 +206,6 @@ export const useRoomCall = (
|
||||
if (hasLegacyCall) {
|
||||
return State.Ongoing;
|
||||
}
|
||||
if (memberCount <= 1 && !canInviteGuests) {
|
||||
return State.NoOneHere;
|
||||
}
|
||||
|
||||
if (!callOptions.includes(PlatformCallType.LegacyCall) && !mayCreateElementCalls && !mayEditWidgets) {
|
||||
return State.NoPermission;
|
||||
@@ -220,14 +214,12 @@ export const useRoomCall = (
|
||||
}, [
|
||||
callOptions,
|
||||
connectedCalls,
|
||||
canInviteGuests,
|
||||
hasGroupCall,
|
||||
hasJitsiWidget,
|
||||
hasLegacyCall,
|
||||
hasManagedHybridWidget,
|
||||
mayCreateElementCalls,
|
||||
mayEditWidgets,
|
||||
memberCount,
|
||||
promptPinWidget,
|
||||
room.roomId,
|
||||
]);
|
||||
@@ -266,10 +258,6 @@ export const useRoomCall = (
|
||||
voiceCallDisabledReason = _t("voip|disabled_ongoing_call");
|
||||
videoCallDisabledReason = _t("voip|disabled_ongoing_call");
|
||||
break;
|
||||
case State.NoOneHere:
|
||||
voiceCallDisabledReason = _t("voip|disabled_no_one_here");
|
||||
videoCallDisabledReason = _t("voip|disabled_no_one_here");
|
||||
break;
|
||||
case State.Unpinned:
|
||||
case State.NotJoined:
|
||||
case State.NoCall:
|
||||
|
||||
Reference in New Issue
Block a user