diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -1654,10 +1654,15 @@ // When starting the app on native, we filter out any local-only multimedia // messages because the relevant context is no longer available const messageIDsToBeRemoved = []; + const threadsToAdd = {}; for (const id in actionPayloadMessages) { const message = actionPayloadMessages[id]; const { threadID } = message; - const existingThread = threads[threadID] ?? newThread(); + let existingThread = threads[threadID]; + if (!existingThread) { + existingThread = newThread(); + threadsToAdd[threadID] = existingThread; + } if ( (message.type === messageTypes.IMAGES || message.type === messageTypes.MULTIMEDIA) && @@ -1715,6 +1720,11 @@ messageStoreOperations, ); + messageStoreOperations.push({ + type: 'replace_threads', + payload: { threads: threadsToAdd }, + }); + return { messageStoreOperations, messageStore: processedMessageStore,