Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPhura committed Apr 7, 2021
1 parent 3be6d37 commit 236e918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/components/attachments/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const FileUpload: React.FC<IFileUploadProps> = (props) => {
}

setFiles((currentFiles) => {
return [...files, ...newAcceptedFiles];
return [...currentFiles, ...newAcceptedFiles];
});

newAcceptedFiles.forEach((item) => startFileUpload(item));
Expand All @@ -108,7 +108,7 @@ export const FileUpload: React.FC<IFileUploadProps> = (props) => {
*/
const updateFile = (fileToUpdate: IUploadFile, updatedFileAttributes: Partial<IUploadFile>) => {
setFiles((currentFiles) => {
return files.map((item) => {
return currentFiles.map((item) => {
if (item.file.name === fileToUpdate.file.name) {
return { ...item, ...updatedFileAttributes };
}
Expand Down

0 comments on commit 236e918

Please sign in to comment.