mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
update download function
Rename it and turn it into async other than using callback
This commit is contained in:
@@ -242,7 +242,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
|
||||
}
|
||||
|
||||
// Selected file download
|
||||
const handleDownloadSelected = () => {
|
||||
const handleSelectedDownload = () => {
|
||||
const folderName = path.substr(path.lastIndexOf('/') + 1)
|
||||
const folder = folderName ? folderName : undefined
|
||||
const files = getFiles()
|
||||
@@ -257,7 +257,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
|
||||
el.remove()
|
||||
} else if (files.length > 1) {
|
||||
setTotalGenerating(true)
|
||||
saveFiles(files, folder, () => setTotalGenerating(false))
|
||||
saveFiles(files, folder).then(() => setTotalGenerating(false))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
|
||||
<span
|
||||
title="Download selected files"
|
||||
className="hover:bg-gray-300 dark:hover:bg-gray-600 p-2 rounded cursor-pointer"
|
||||
onClick={handleDownloadSelected}
|
||||
onClick={handleSelectedDownload}
|
||||
>
|
||||
<FontAwesomeIcon icon={['far', 'arrow-alt-circle-down']} />
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user