Enqueues edit message in the message-reducers state so that the edit/replace message is being sent over the websocket
Simplifies reducer -> pulls action with same function together
@@ -15,18 +15,12 @@ const initialState = Immutable.fromJS({
});
export function messagesReducer(messages = initialState, action = {}) {
switch (action.type) {
- case actionTypes.needs.edit: {
- console.debug(
- "payload = {eventUri, message, needUri, need: draft, oldNeed}"
- );
- console.debug(
- "message-reducer actionTypes.needs.edit todo: impl / payload-> ",
- action.payload
- );
- //TODO: IMPL
- return messages;
- }
-
+ case actionTypes.connections.open:
+ case actionTypes.connections.sendChatMessage:
+ case actionTypes.connections.rate:
+ case actionTypes.connections.close:
+ case actionTypes.messages.send:
+ case actionTypes.needs.edit:
case actionTypes.needs.connect:
case actionTypes.personas.create:
case actionTypes.needs.create:
@@ -61,16 +55,6 @@ export function messagesReducer(messages = initialState, action = {}) {
.setIn(["waitingForAnswer", pendingEventUri], msg);
}
- case actionTypes.connections.open:
- case actionTypes.connections.sendChatMessage:
- case actionTypes.connections.rate:
- case actionTypes.connections.close:
- case actionTypes.messages.send:
- return messages.setIn(
- ["enqueued", action.payload.eventUri],
- action.payload.message
- );
-
case actionTypes.connections.sendChatMessageRefreshDataOnSuccess:
return messages
.setIn(["enqueued", action.payload.eventUri], action.payload.message)
