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 40ff12e commit 888dc7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@
"module.filesManager.pendingUploadModalActionButton": "Ok",
"module.filesManager.pendingUploadModalHeader": "Files uploading",
"module.filesManager.pendingUploadModalTextDetailsInfo": "The first {count, plural, one {file} other {# files}} will be uploaded to the device.",
"module.filesManager.pendingUploadModalTextInfo": "Mudita Center cannot load all files.\nThe number of selected files exceeds the limit.",
"module.filesManager.pendingUploadModalAbortButtonText": "Abort",
"module.filesManager.pendingUploadModalTextInfo": "Mudita Center cannot load all files.\\nThe number of selected files exceeds the limit.",
"module.filesManager.pendingUploadModalTitle": "Upload files",
"module.filesManager.selectionNumber": "{num, plural, =-1 {All Files} one {# File} other {# Files}} selected",
"module.filesManager.tooManyFilesTooltipDescription": "The maximum number of files has been reached ({filesSlotsHarmonyMaxLimit} files)",
Expand Down
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 888dc7e

Please sign in to comment.