diff --git a/packages/app/src/files-manager/actions/abort-pending-upload.action.ts b/packages/app/src/files-manager/actions/abort-pending-upload.action.ts index 210b02139d..8949ee8f5b 100644 --- a/packages/app/src/files-manager/actions/abort-pending-upload.action.ts +++ b/packages/app/src/files-manager/actions/abort-pending-upload.action.ts @@ -15,6 +15,6 @@ export const abortPendingUpload = createAsyncThunk( FilesManagerEvent.AbortPendingUpload, (_, { dispatch }) => { dispatch(setPendingFilesToUpload([])) - dispatch(setUploadingState(State.Initial)) + dispatch(setUploadingState(State.Loaded)) } ) diff --git a/packages/app/src/files-manager/components/files-manager/files-manager.component.tsx b/packages/app/src/files-manager/components/files-manager/files-manager.component.tsx index 3510e16328..d384839fc6 100644 --- a/packages/app/src/files-manager/components/files-manager/files-manager.component.tsx +++ b/packages/app/src/files-manager/components/files-manager/files-manager.component.tsx @@ -62,7 +62,6 @@ const FilesManager: FunctionComponent = ({ abortPendingUpload, continuePendingUpload, }) => { - const uploadTimeoutRef = useRef | null>(null) const fileInputRef = useRef(null) const { noFoundFiles, searchValue, filteredFiles, handleSearchValueChange } = useFilesFilter({ files: files ?? [] }) @@ -142,12 +141,7 @@ const FilesManager: FunctionComponent = ({ } 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) @@ -182,13 +176,13 @@ const FilesManager: FunctionComponent = ({ 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