From f9f99f0edbf97d65ce83fdf66d5854809d4c5414 Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Thu, 11 Mar 2021 12:59:14 +0100 Subject: [PATCH] [#1214] Duplicate messages in the redux store (#1216) closes #1214 --- .../ui/src/reducers/data/messages/index.ts | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/frontend/ui/src/reducers/data/messages/index.ts b/frontend/ui/src/reducers/data/messages/index.ts index e6a7640441..596c853beb 100644 --- a/frontend/ui/src/reducers/data/messages/index.ts +++ b/frontend/ui/src/reducers/data/messages/index.ts @@ -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,