add selected download notification
This commit is contained in:
parent
e706051238
commit
1b74a378e9
1 changed files with 10 additions and 1 deletions
|
@ -262,7 +262,16 @@ const FileListing: FunctionComponent<{ query?: ParsedUrlQuery }> = ({ query }) =
|
||||||
el.remove()
|
el.remove()
|
||||||
} else if (files.length > 1) {
|
} else if (files.length > 1) {
|
||||||
setTotalGenerating(true)
|
setTotalGenerating(true)
|
||||||
saveFiles(files, folder).then(() => setTotalGenerating(false))
|
const toastId = toast.loading('Downloading selected files. This may be slow...')
|
||||||
|
saveFiles(files, folder).then(() => {
|
||||||
|
setTotalGenerating(false)
|
||||||
|
toast.dismiss(toastId)
|
||||||
|
toast.success('Finished to download selected files.')
|
||||||
|
}).catch(() => {
|
||||||
|
setTotalGenerating(false)
|
||||||
|
toast.dismiss(toastId)
|
||||||
|
toast.error('Failed to download selected files.')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue