From 2f51b9ed0e8bef2fe2ee9509aaba39913e39eca3 Mon Sep 17 00:00:00 2001 From: Mikita Butsko Date: Wed, 20 Dec 2023 11:17:35 +0100 Subject: [PATCH] fix: fix reupload file multiple occurences (Issue #382) (#391) --- src/components/Chat/ChatInput/ChatInputAttachment.tsx | 5 ++++- src/components/Files/FileItem.tsx | 10 ++++++++-- src/store/files/files.reducers.ts | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/Chat/ChatInput/ChatInputAttachment.tsx b/src/components/Chat/ChatInput/ChatInputAttachment.tsx index 319184d5bd..3a812cd017 100644 --- a/src/components/Chat/ChatInput/ChatInputAttachment.tsx +++ b/src/components/Chat/ChatInput/ChatInputAttachment.tsx @@ -57,7 +57,10 @@ export const ChatInputAttachment = ({
{file.status === 'FAILED' && ( )} )} {item.status && cancelAllowedStatuses.has(item.status) ? ( ) : ( , ) => { + state.files = state.files.filter((file) => file.id !== payload.id); state.files.push({ id: payload.id, name: payload.name,