Better handling of reconnect. Clear the state properly and handle spotlights.
This commit is contained in:
@@ -110,6 +110,11 @@ const consumers = (state = initialState, action) =>
|
||||
return { ...state, [consumerId]: newConsumer };
|
||||
}
|
||||
|
||||
case 'CLEAR_CONSUMERS':
|
||||
{
|
||||
return initialState;
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const peer = (state = {}, action) =>
|
||||
const initialState = {};
|
||||
|
||||
const peer = (state = initialState, action) =>
|
||||
{
|
||||
switch (action.type)
|
||||
{
|
||||
@@ -85,7 +87,7 @@ const peer = (state = {}, action) =>
|
||||
}
|
||||
};
|
||||
|
||||
const peers = (state = {}, action) =>
|
||||
const peers = (state = initialState, action) =>
|
||||
{
|
||||
switch (action.type)
|
||||
{
|
||||
@@ -139,6 +141,11 @@ const peers = (state = {}, action) =>
|
||||
return { ...state, [oldPeer.id]: peer(oldPeer, action) };
|
||||
}
|
||||
|
||||
case 'CLEAR_PEERS':
|
||||
{
|
||||
return initialState;
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -212,6 +212,11 @@ const room = (state = initialState, action) =>
|
||||
return { ...state, spotlights };
|
||||
}
|
||||
|
||||
case 'CLEAR_SPOTLIGHTS':
|
||||
{
|
||||
return { ...state, spotlights: [] };
|
||||
}
|
||||
|
||||
case 'SET_LOBBY_PEERS_PROMOTION_IN_PROGRESS':
|
||||
return { ...state, lobbyPeersPromotionInProgress: action.payload.flag };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user