Skip to content

Commit

Permalink
handle unselect delegate conference participant
Browse files Browse the repository at this point in the history
  • Loading branch information
dtubaileh committed Jun 2, 2022
1 parent 89428f4 commit da1ebf3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Calls/Conference/ConferenceDelegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export const ConferenceDelegateContainer: React.FunctionComponent<IProps> = ({


const onParticipantSelected = (selectedContact: IContact) => {
setSelectedParticipantToDelegate(selectedContact as IConferenceParticipants);
if (selectedContact.jId !== selectedParticipantToDelegate?.jId) {
setSelectedParticipantToDelegate(selectedContact as IConferenceParticipants);
} else {
// Check if its already had been selected, to unselect this contact
setSelectedParticipantToDelegate(undefined);
}
}

const onEndPress = () => {
Expand Down Expand Up @@ -103,12 +108,12 @@ export const ConferenceDelegateContainer: React.FunctionComponent<IProps> = ({
<TouchableOpacity onPress={onClosePressed}>
<Text style={defaultModalStyle.modalOptionsText}>{Strings.cancel}</Text>
</TouchableOpacity>
{(delegateParticipants.length === 0 || !selectedParticipantToDelegate) && <TouchableOpacity onPress={onEndPress}>
<TouchableOpacity onPress={onEndPress}>
<Text style={defaultModalStyle.endMeetingText}>{Strings.EndMeeting}</Text>
</TouchableOpacity>}
{selectedParticipantToDelegate && <TouchableOpacity onPress={onDelegatePress} style={selectedParticipantToDelegate === undefined ? { opacity: 0.2 } : { opacity: 1 }} disabled={selectedParticipantToDelegate === undefined}>
</TouchableOpacity>
<TouchableOpacity onPress={onDelegatePress} style={selectedParticipantToDelegate === undefined ? { opacity: 0.2 } : { opacity: 1 }} disabled={selectedParticipantToDelegate === undefined}>
<Text style={defaultModalStyle.modalOptionsText}>{Strings.Delegate}</Text>
</TouchableOpacity>}
</TouchableOpacity>
</View>
</View>
</View>
Expand Down

0 comments on commit da1ebf3

Please sign in to comment.