From bb250d4fb5a4b59f8a09f1aa6655342ccd6eac78 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 31 Mar 2022 18:06:35 -0700 Subject: [PATCH] startCall: wait for startOutgoingDirectCall before updating lobby --- ts/state/ducks/calling.ts | 2 +- ts/test-electron/state/ducks/calling_test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/state/ducks/calling.ts b/ts/state/ducks/calling.ts index 62a571a410..2cd879d2b3 100644 --- a/ts/state/ducks/calling.ts +++ b/ts/state/ducks/calling.ts @@ -1220,7 +1220,7 @@ function startCall( return async (dispatch, getState) => { switch (payload.callMode) { case CallMode.Direct: - calling.startOutgoingDirectCall( + await calling.startOutgoingDirectCall( payload.conversationId, payload.hasLocalAudio, payload.hasLocalVideo diff --git a/ts/test-electron/state/ducks/calling_test.ts b/ts/test-electron/state/ducks/calling_test.ts index 497c5551f0..e738603dbd 100644 --- a/ts/test-electron/state/ducks/calling_test.ts +++ b/ts/test-electron/state/ducks/calling_test.ts @@ -1904,9 +1904,9 @@ describe('calling duck', () => { sinon.assert.notCalled(this.callingStartOutgoingDirectCall); }); - it('saves direct calls and makes them active', () => { + it('saves direct calls and makes them active', async () => { const dispatch = sinon.spy(); - startCall({ + await startCall({ callMode: CallMode.Direct, conversationId: 'fake-conversation-id', hasLocalAudio: true,