Skip to content

Commit

Permalink
[#1214] Duplicate messages in the redux store (#1216)
Browse files Browse the repository at this point in the history
closes #1214
  • Loading branch information
bitboxer authored Mar 11, 2021
1 parent 163a30f commit f9f99f0
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions frontend/ui/src/reducers/data/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,6 @@ function mergeMessages(oldMessages: Message[], newMessages: Message[]): Message[
export default function messagesReducer(state = initialState, action: Action): Messages {
switch (action.type) {
case getType(actions.loadingMessagesAction):
if (state.all[action.payload.conversationId]) {
return {
...state,
all: {
...state.all,
[action.payload.conversationId]: [
...mergeMessages([...action.payload.messages], []),
...state.all[action.payload.conversationId],
],
},
};
} else {
return {
...state,
all: {
...state.all,
[action.payload.conversationId]: [...mergeMessages([...action.payload.messages], [])],
},
};
}

case getType(actions.addMessagesAction):
return {
...state,
Expand Down

0 comments on commit f9f99f0

Please sign in to comment.