Removed some unused code, and cleaned up some ternary operations.

This commit is contained in:
Håvar Aambø Fosstveit
2018-12-20 11:02:32 +01:00
parent 580b3b88e3
commit ea85041d78
7 changed files with 8 additions and 69 deletions
-36
View File
@@ -1,36 +0,0 @@
const initialState =
{
showChat : false,
disabledInput : false,
badge : 0
};
const chatbehavior = (state = initialState, action) =>
{
switch (action.type)
{
case 'TOGGLE_CHAT':
{
const showChat = !state.showChat;
const badge = 0;
return { ...state, showChat, badge };
}
case 'TOGGLE_INPUT_DISABLED':
{
const disabledInput = !state.disabledInput;
return { ...state, disabledInput };
}
case 'INCREASE_BADGE':
{
return { ...state, badge: state.badge + (state.showChat ? 0 : 1) };
}
default:
return state;
}
};
export default chatbehavior;
-2
View File
@@ -6,7 +6,6 @@ import peers from './peers';
import consumers from './consumers';
import notifications from './notifications';
import chatmessages from './chatmessages';
import chatbehavior from './chatbehavior';
import toolarea from './toolarea';
import files from './files';
@@ -19,7 +18,6 @@ const reducers = combineReducers(
consumers,
notifications,
chatmessages,
chatbehavior,
toolarea,
files
});
-19
View File
@@ -1,19 +0,0 @@
const sharing = (state = [], action) =>
{
switch (action.type)
{
case 'SEND_FILE':
return [ ...state, { ...action.payload, me: true } ];
case 'ADD_FILE':
return [ ...state, action.payload ];
case 'ADD_FILE_HISTORY':
return [ ...action.payload.fileHistory, ...state ];
default:
return state;
}
};
export default sharing;