mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[subtask, mastertask] dowmload files gif loader fix
This commit is contained in:
1 parent
412530fb93
commit
f8656396e7
4 files changed
+37
-28
No files matched your search
@@ -56,15 +56,19 @@ export default {
|
||||
|
||||
methods: {
|
||||
async downloadFile(id) {
|
||||
this.showDownload = true
|
||||
try {
|
||||
const file = await this.$axios.get_auth_data(`v1/subtasks/${this.subtask.id}`, { responseType: "arraybuffer" })
|
||||
console.log(file)
|
||||
FileSaver.saveAs(file.files[id].path, file.files[id].name)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
this.showDownload = false
|
||||
this.showDownload = true // Show loader
|
||||
|
||||
// Iterate over each file in the task
|
||||
const file = this.subtask.files[id]
|
||||
const fileName = file.name
|
||||
|
||||
fetch(file.path)
|
||||
.then(response => response.blob())
|
||||
.then(blob => {
|
||||
FileSaver.saveAs(blob, fileName)
|
||||
this.showDownload = false
|
||||
})
|
||||
.catch(error => this.$toast.error(error))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user