Support selecting Peers from ParticipantList

This commit is contained in:
Torjus
2018-08-02 12:44:28 +02:00
parent 9b407d58a0
commit 9e23683f0b
4 changed files with 43 additions and 61 deletions
+10 -1
View File
@@ -72,7 +72,16 @@ const room = (state = initialState, action) =>
return { ...state, mode: action.payload.mode };
case 'SET_SELECTED_PEER':
return { ...state, selectedPeerName: action.payload.selectedPeerName };
{
const { selectedPeerName } = action.payload;
return {
...state,
selectedPeerName : state.selectedPeerName === selectedPeerName ?
null : selectedPeerName
};
}
default:
return state;