Skip to content

Commit

Permalink
fix: fix reupload file multiple occurences (Issue #382) (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikitabut authored Dec 20, 2023
1 parent 9df13aa commit 2f51b9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/Chat/ChatInput/ChatInputAttachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export const ChatInputAttachment = ({
<div className="flex gap-3">
{file.status === 'FAILED' && (
<button onClick={() => onRetryFile(file.id)}>
<IconReload className="shrink-0 text-gray-500" size={18} />
<IconReload
className="shrink-0 text-gray-500 hover:text-blue-500"
size={18}
/>
</button>
)}
<button onClick={() => onUnselectFile(file.id)}>
Expand Down
10 changes: 8 additions & 2 deletions src/components/Files/FileItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,18 @@ export const FileItem = ({
)}
{item.status === 'FAILED' && (
<button onClick={handleRetry}>
<IconReload className="shrink-0 text-gray-500" size={18} />
<IconReload
className="shrink-0 text-gray-500 hover:text-blue-500"
size={18}
/>
</button>
)}
{item.status && cancelAllowedStatuses.has(item.status) ? (
<button onClick={handleCancelFile}>
<IconX className="shrink-0 text-gray-500" size={18} />
<IconX
className="shrink-0 text-gray-500 hover:text-blue-500"
size={18}
/>
</button>
) : (
<FileItemContextMenu
Expand Down
1 change: 1 addition & 0 deletions src/store/files/files.reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const filesSlice = createSlice({
name: string;
}>,
) => {
state.files = state.files.filter((file) => file.id !== payload.id);
state.files.push({
id: payload.id,
name: payload.name,
Expand Down

0 comments on commit 2f51b9e

Please sign in to comment.