Don't prematurely claim that we've joined the call in widget mode
In GroupCallView we do 'await enter()' when responding to a widget API join request, but it turns out enter wasn't actually returning a promise until now. The consequence of this was that in Element Web, when you click the join button you get shown a blank screen for a moment. This fixes that half-second moment of the UI being broken, allowing Element Web to show the intermediate 'joining' state.
This commit is contained in:
parent
efc25fd4ec
commit
e4a3dbd7f7
1 changed files with 3 additions and 3 deletions
|
|
@ -65,7 +65,7 @@ export interface UseGroupCallReturnType {
|
||||||
localVideoMuted: boolean;
|
localVideoMuted: boolean;
|
||||||
error: TranslatedError | null;
|
error: TranslatedError | null;
|
||||||
initLocalCallFeed: () => void;
|
initLocalCallFeed: () => void;
|
||||||
enter: () => void;
|
enter: () => Promise<void>;
|
||||||
leave: () => void;
|
leave: () => void;
|
||||||
toggleLocalVideoMuted: () => void;
|
toggleLocalVideoMuted: () => void;
|
||||||
toggleMicrophoneMuted: () => void;
|
toggleMicrophoneMuted: () => void;
|
||||||
|
|
@ -483,7 +483,7 @@ export function useGroupCall(
|
||||||
[groupCall]
|
[groupCall]
|
||||||
);
|
);
|
||||||
|
|
||||||
const enter = useCallback(() => {
|
const enter = useCallback(async () => {
|
||||||
if (
|
if (
|
||||||
groupCall.state !== GroupCallState.LocalCallFeedUninitialized &&
|
groupCall.state !== GroupCallState.LocalCallFeedUninitialized &&
|
||||||
groupCall.state !== GroupCallState.LocalCallFeedInitialized
|
groupCall.state !== GroupCallState.LocalCallFeedInitialized
|
||||||
|
|
@ -498,7 +498,7 @@ export function useGroupCall(
|
||||||
// have started tracking by the time calls start getting created.
|
// have started tracking by the time calls start getting created.
|
||||||
groupCallOTelMembership?.onJoinCall();
|
groupCallOTelMembership?.onJoinCall();
|
||||||
|
|
||||||
groupCall.enter().catch((error) => {
|
await groupCall.enter().catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
updateState({ error });
|
updateState({ error });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue