Fixed isLoading never ends when downloading logfile via showSaveFilePicker

This commit is contained in:
abdulmohsen
2024-05-13 13:11:12 +03:00
parent 686d6bb82f
commit e8b59c9852

View File

@@ -144,9 +144,14 @@ const downloadFile = () => {
const response = request(`/log/${filename}?download=1`)
if ('showSaveFilePicker' in window) {
response.then(async res => res.body.pipeTo(await (await showSaveFilePicker({
suggestedName: `${filename}`
})).createWritable()))
response.then(async res => {
isDownloading.value = false;
return res.body.pipeTo(await (await showSaveFilePicker({
suggestedName: `${filename}`
})).createWritable())
})
} else {
response.then(res => res.blob()).then(blob => {
isDownloading.value = false;