Added user interface for lastN (only peers in lastN are visible, others stay in HiddenPeers component)

This commit is contained in:
Stefan Otto
2018-10-29 12:48:47 +01:00
parent d7ce8253e2
commit ed5ef29fba
8 changed files with 262 additions and 52 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ const initialState =
toolbarsVisible : true,
mode : 'democratic',
selectedPeerName : null,
lastN : null
lastN : []
};
const room = (state = initialState, action) =>
+17 -1
View File
@@ -19,6 +19,22 @@ const toolarea = (state = initialState, action) =>
return { ...state, toolAreaOpen, unreadMessages, unreadFiles };
}
case 'OPEN_TOOL_AREA':
{
const toolAreaOpen = true;
const unreadMessages = state.currentToolTab === 'chat' ? 0 : state.unreadMessages;
const unreadFiles = state.currentToolTab === 'files' ? 0 : state.unreadFiles;
return { ...state, toolAreaOpen, unreadMessages, unreadFiles };
}
case 'CLOSE_TOOL_AREA':
{
const toolAreaOpen = false;
return { ...state, toolAreaOpen };
}
case 'SET_TOOL_TAB':
{
const { toolTab } = action.payload;
@@ -30,7 +46,7 @@ const toolarea = (state = initialState, action) =>
case 'ADD_NEW_RESPONSE_MESSAGE':
{
if (state.toolAreaOpen && state.currentToolTab === 'chat')
if (state.toolAreaOpen && state.currentToolTab === 'chat')
{
return state;
}