feat(prejoin/web): updated shouldAutoKnock helper (#11725)

* feat(prejoin) updated shouldAutoKnock helper
This commit is contained in:
Calinteodor 2022-06-23 17:39:10 +03:00 committed by GitHub
parent 8f1fae79e4
commit 4b4caf5b1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -160,8 +160,11 @@ export function isPrejoinPageVisible(state: Object): boolean {
* @returns {boolean}
*/
export function shouldAutoKnock(state: Object): boolean {
const { iAmRecorder, iAmSipGateway, autoKnockLobby } = state['features/base/config'];
const { iAmRecorder, iAmSipGateway, autoKnockLobby, prejoinConfig } = state['features/base/config'];
const { userSelectedSkipPrejoin } = state['features/base/settings'];
const isPrejoinEnabled = prejoinConfig?.enabled;
return (isPrejoinPageVisible(state) || autoKnockLobby || (iAmRecorder && iAmSipGateway))
return ((isPrejoinEnabled && !userSelectedSkipPrejoin)
|| autoKnockLobby || (iAmRecorder && iAmSipGateway))
&& !state['features/lobby'].knocking;
}