Refactor stateActions for better overview.
This commit is contained in:
@@ -3,7 +3,7 @@ import
|
||||
createNewMessage
|
||||
} from './helper';
|
||||
|
||||
const chatmessages = (state = [], action) =>
|
||||
const chat = (state = [], action) =>
|
||||
{
|
||||
switch (action.type)
|
||||
{
|
||||
@@ -30,14 +30,9 @@ const chatmessages = (state = [], action) =>
|
||||
return [ ...state, ...chatHistory ];
|
||||
}
|
||||
|
||||
case 'DROP_MESSAGES':
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default chatmessages;
|
||||
export default chat;
|
||||
@@ -85,13 +85,6 @@ const files = (state = {}, action) =>
|
||||
return { ...state, [magnetUri]: newFile };
|
||||
}
|
||||
|
||||
case 'REMOVE_FILE':
|
||||
{
|
||||
const { magnetUri } = action.payload;
|
||||
|
||||
return state.filter((file) => file.magnetUri !== magnetUri);
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -116,13 +116,6 @@ const room = (state = initialState, action) =>
|
||||
return { ...state, torrentSupport: supported };
|
||||
}
|
||||
|
||||
case 'TOGGLE_SETTINGS':
|
||||
{
|
||||
const showSettings = !state.showSettings;
|
||||
|
||||
return { ...state, showSettings };
|
||||
}
|
||||
|
||||
case 'TOGGLE_JOINED':
|
||||
{
|
||||
const joined = !state.joined;
|
||||
|
||||
@@ -7,7 +7,7 @@ import lobbyPeers from './lobbyPeers';
|
||||
import consumers from './consumers';
|
||||
import peerVolumes from './peerVolumes';
|
||||
import notifications from './notifications';
|
||||
import chatmessages from './chatmessages';
|
||||
import chat from './chat';
|
||||
import toolarea from './toolarea';
|
||||
import files from './files';
|
||||
import settings from './settings';
|
||||
@@ -21,7 +21,7 @@ export default combineReducers({
|
||||
consumers,
|
||||
peerVolumes,
|
||||
notifications,
|
||||
chatmessages,
|
||||
chat,
|
||||
toolarea,
|
||||
files,
|
||||
settings
|
||||
|
||||
Reference in New Issue
Block a user