fix: upload q and drive size error (#220)

* refactor: usetransfers hook functions
* refactor: bulk actions code style and readability
* fix: use upload q inflight size for subsequent uploads
* refactor: runUploadQueue execution
This commit is contained in:
Bálint Ujvári
2026-03-10 12:42:34 +01:00
parent bc2c0addbb
commit 8992c189fd
8 changed files with 348 additions and 328 deletions
+1 -6
View File
@@ -3,6 +3,7 @@ import { FileInfo, FileManager } from '@solarpunkltd/file-manager-lib'
import { DownloadProgress, DownloadState } from '../constants/transfers'
import { AbortManager } from './abortManager'
import { isDirectoryPickerSupported, isPickerSupported } from './fileOperations'
import { guessMime, VIEWERS } from './view'
const downloadAborts = new AbortManager()
@@ -141,12 +142,6 @@ interface FileInfoWithHandle {
cancelled?: boolean
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const isPickerSupported = (): boolean => typeof (window as any).showSaveFilePicker === 'function'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const isDirectoryPickerSupported = (): boolean => typeof (window as any).showDirectoryPicker === 'function'
const isUserCancellation = (error: unknown): boolean => {
const errName = (error as { name?: string })?.name
@@ -151,3 +151,12 @@ export async function performBulkFileOperation({
}
}
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const isPickerSupported = (): boolean => typeof (window as any).showSaveFilePicker === 'function'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const isDirectoryPickerSupported = (): boolean => typeof (window as any).showDirectoryPicker === 'function'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const isElementPickerSupported = (el: any): boolean => typeof (el as HTMLInputElement).showPicker === 'function'