From 4b4caf5b1c0459c1c861da2fdd27fc1062a9f86a Mon Sep 17 00:00:00 2001 From: Calinteodor Date: Thu, 23 Jun 2022 17:39:10 +0300 Subject: [PATCH] feat(prejoin/web): updated shouldAutoKnock helper (#11725) * feat(prejoin) updated shouldAutoKnock helper --- react/features/prejoin/functions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/react/features/prejoin/functions.js b/react/features/prejoin/functions.js index 001f30d52..93d37cf41 100644 --- a/react/features/prejoin/functions.js +++ b/react/features/prejoin/functions.js @@ -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; }