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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user