Skip to content

Commit

Permalink
Revert "[CP-2086][FIX] The user can decline to upload files to the Fi…
Browse files Browse the repository at this point in the history
…le Manager if they select more files than they can add within the limit [Harmony] (#1402)"

This reverts commit 40ff12e.
  • Loading branch information
dkarski committed Sep 29, 2023
1 parent 843ea4a commit 76dfc06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export const abortPendingUpload = createAsyncThunk(
FilesManagerEvent.AbortPendingUpload,
(_, { dispatch }) => {
dispatch(setPendingFilesToUpload([]))
dispatch(setUploadingState(State.Initial))
dispatch(setUploadingState(State.Loaded))
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const FilesManager: FunctionComponent<FilesManagerProps> = ({
abortPendingUpload,
continuePendingUpload,
}) => {
const uploadTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
const fileInputRef = useRef<HTMLInputElement>(null)
const { noFoundFiles, searchValue, filteredFiles, handleSearchValueChange } =
useFilesFilter({ files: files ?? [] })
Expand Down Expand Up @@ -142,12 +141,7 @@ const FilesManager: FunctionComponent<FilesManagerProps> = ({
} else if (uploading === State.Loaded) {
updateFieldState("uploading", false)
updateFieldState("deletingInfo", false)
if (uploadingFileCount) {
updateFieldState("uploadingInfo", true)
}
} else if (uploading === State.Pending) {
updateFieldState("uploadingInfo", false)
clearTimeout(uploadTimeoutRef.current || undefined)
updateFieldState("uploadingInfo", true)
} else if (uploading === State.Failed) {
updateFieldState("uploading", false)
updateFieldState("uploadingFailed", true)
Expand Down Expand Up @@ -182,13 +176,13 @@ const FilesManager: FunctionComponent<FilesManagerProps> = ({
return
}

uploadTimeoutRef.current = setTimeout(() => {
const hideInfoPopupsTimeout = setTimeout(() => {
updateFieldState("uploadingInfo", false)
resetUploadingStateAfterSuccess()
}, 5000)

return () => {
clearTimeout(uploadTimeoutRef.current || undefined)
clearTimeout(hideInfoPopupsTimeout)
}
// AUTO DISABLED - fix me if you like :)
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit 76dfc06

Please sign in to comment.