diff --git a/ts/state/ducks/stagedAttachments.ts b/ts/state/ducks/stagedAttachments.ts index 727b3ab47..fd4f6921f 100644 --- a/ts/state/ducks/stagedAttachments.ts +++ b/ts/state/ducks/stagedAttachments.ts @@ -37,9 +37,12 @@ const stagedAttachmentsSlice = createSlice({ } const allAttachments = _.concat(currentStagedAttachments, newAttachments); - const uniqAttachments = _.uniqBy(allAttachments, m => m.fileName); + const pastedAttachments = allAttachments.filter(m => m.fileName === 'image.png'); + const allAttachmentsExceptPasted = allAttachments.filter(m => m.fileName !== 'image.png'); + const uniqAttachments = _.uniqBy(allAttachmentsExceptPasted, m => m.fileName); + const finalAttachments = _.concat(uniqAttachments, pastedAttachments); - state.stagedAttachments[conversationKey] = uniqAttachments; + state.stagedAttachments[conversationKey] = finalAttachments; return state; }, removeAllStagedAttachmentsInConversation(