@@ -17,7 +17,6 @@ import {
1717 MEDIA_TYPE_CHAT ,
1818 MEDIA_TYPE_EMAIL ,
1919 MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE ,
20- MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE ,
2120} from './constants' ;
2221import { DeviceTypeFlags } from '../task.types' ;
2322
@@ -177,9 +176,11 @@ export function getConferenceButtonVisibility(
177176 webRtcEnabled : boolean ,
178177 isCall : boolean ,
179178 isChat : boolean ,
180- isBeingConsulted : boolean
179+ isBeingConsulted : boolean ,
180+ multiPartyConferenceEnabled : boolean
181181) : Visibility {
182- const isVisible = ( ( isBrowser && isCall && webRtcEnabled ) || isChat ) && ! isBeingConsulted ;
182+ const isVisible =
183+ ( ( isBrowser && isCall && webRtcEnabled ) || isChat ) && ! isBeingConsulted && multiPartyConferenceEnabled ;
183184
184185 return { isVisible, isEnabled : true } ;
185186}
@@ -199,9 +200,10 @@ export function getExitConferenceButtonVisibility(
199200 isConsultInitiatedOrAccepted : boolean ,
200201 consultCallHeld : boolean ,
201202 isHeld : boolean ,
202- isConsultCompleted : boolean
203+ isConsultCompleted : boolean ,
204+ multiPartyConferenceEnabled : boolean
203205) : Visibility {
204- const isVisible = isConferenceInProgress && ! isConsultInitiatedOrAccepted ;
206+ const isVisible = isConferenceInProgress && ! isConsultInitiatedOrAccepted && multiPartyConferenceEnabled ;
205207 const isConferenceWithConsultNotHeld = isConferenceInProgress && isConsultInitiatedOrAccepted && ! consultCallHeld ;
206208 // Disable if: conference with consult not held OR (held AND in conference AND consult completed)
207209 const isEnabled = ! isConferenceWithConsultNotHeld && ! ( isHeld && isConferenceInProgress && isConsultCompleted ) ;
@@ -217,9 +219,10 @@ export function getMergeConferenceButtonVisibility(
217219 isConsultAccepted : boolean ,
218220 consultCallHeld : boolean ,
219221 isConferenceInProgress : boolean ,
220- isCustomerInCall : boolean
222+ isCustomerInCall : boolean ,
223+ multiPartyConferenceEnabled : boolean
221224) : Visibility {
222- const isVisible = isConsultInitiatedOrAccepted && isCustomerInCall ;
225+ const isVisible = isConsultInitiatedOrAccepted && isCustomerInCall && multiPartyConferenceEnabled ;
223226 const isConferenceWithConsultNotHeld = isConferenceInProgress && isConsultInitiatedOrAccepted && ! consultCallHeld ;
224227 const isEnabled = isConsultAccepted && consultCallHeld && ! isConferenceWithConsultNotHeld ;
225228
@@ -291,9 +294,10 @@ export function getMergeConferenceConsultButtonVisibility(
291294 isConsultAccepted : boolean ,
292295 isConsultInitiated : boolean ,
293296 consultCallHeld : boolean ,
294- isCustomerInCall : boolean
297+ isCustomerInCall : boolean ,
298+ multiPartyConferenceEnabled : boolean
295299) : Visibility {
296- const isVisible = isConsultAccepted || isConsultInitiated ;
300+ const isVisible = ( isConsultAccepted || isConsultInitiated ) && multiPartyConferenceEnabled ;
297301 const isEnabled = ! consultCallHeld && isConsultAccepted && isCustomerInCall ;
298302
299303 return { isVisible, isEnabled} ;
@@ -419,9 +423,6 @@ export function getControlsVisibility(
419423
420424 // Calculate conference participants count
421425 const conferenceParticipantsCount = getConferenceParticipantsCount ( task ) ;
422- const maxParticipantsInConference = multiPartyConferenceEnabled
423- ? MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE
424- : MAX_PARTICIPANTS_IN_THREE_PARTY_CONFERENCE ;
425426
426427 // Calculate consult status flags (REUSED CONDITIONS)
427428 const isConsultInitiated = taskConsultStatus === ConsultStatus . CONSULT_INITIATED ;
@@ -472,20 +473,29 @@ export function getControlsVisibility(
472473
473474 // Transfer and conference controls
474475 transfer : getTransferButtonVisibility ( isTransferVisibility , isConferenceInProgress , isConsultInitiatedOrAccepted ) ,
475- conference : getConferenceButtonVisibility ( isBrowser , webRtcEnabled , isCall , isChat , isBeingConsulted ) ,
476+ conference : getConferenceButtonVisibility (
477+ isBrowser ,
478+ webRtcEnabled ,
479+ isCall ,
480+ isChat ,
481+ isBeingConsulted ,
482+ multiPartyConferenceEnabled
483+ ) ,
476484 exitConference : getExitConferenceButtonVisibility (
477485 isConferenceInProgress ,
478486 isConsultInitiatedOrAccepted ,
479487 consultCallHeld ,
480488 isHeld ,
481- isConsultCompleted
489+ isConsultCompleted ,
490+ multiPartyConferenceEnabled
482491 ) ,
483492 mergeConference : getMergeConferenceButtonVisibility (
484493 isConsultInitiatedOrAcceptedOnly ,
485494 isConsultAccepted ,
486495 consultCallHeld ,
487496 isConferenceInProgress ,
488- isCustomerInCall
497+ isCustomerInCall ,
498+ multiPartyConferenceEnabled
489499 ) ,
490500
491501 // Consult controls
@@ -495,7 +505,7 @@ export function getControlsVisibility(
495505 isConsultInProgress ,
496506 isCustomerInCall ,
497507 conferenceParticipantsCount ,
498- maxParticipantsInConference ,
508+ MAX_PARTICIPANTS_IN_MULTIPARTY_CONFERENCE ,
499509 isBeingConsulted ,
500510 isHeld ,
501511 isConsultCompleted ,
@@ -524,7 +534,8 @@ export function getControlsVisibility(
524534 isConsultAccepted ,
525535 isConsultInitiated ,
526536 consultCallHeld ,
527- isCustomerInCall
537+ isCustomerInCall ,
538+ multiPartyConferenceEnabled
528539 ) ,
529540 muteUnmuteConsult : getMuteUnmuteConsultButtonVisibility (
530541 isBrowser ,
0 commit comments