Remove unused dependencies. Fix handling of missing roomId.

This commit is contained in:
Håvar Aambø Fosstveit
2019-06-05 20:40:59 +02:00
parent 21a1322415
commit 4b3219f614
3 changed files with 20 additions and 34 deletions
+6 -3
View File
@@ -1,5 +1,3 @@
import omit from 'lodash/omit';
const peer = (state = {}, action) =>
{
switch (action.type)
@@ -58,7 +56,12 @@ const peers = (state = {}, action) =>
case 'REMOVE_PEER':
{
return omit(state, [ action.payload.peerId ]);
const { peerId } = action.payload;
const newState = { ...state };
delete newState[peerId];
return newState;
}
case 'SET_PEER_DISPLAY_NAME':