Skip to content

Commit

Permalink
Remove message
Browse files Browse the repository at this point in the history
  • Loading branch information
alangrainger committed Oct 14, 2023
1 parent 0693fbb commit ab89cc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ export default class API {
})
})

let count = 1
// let count = 1
const promises: Promise<void>[] = []
for (const queueItem of this.uploadQueue) {
// Get the result from check-files (if exists)
const checkFile = res?.files.find((item: FileUpload) => item.hash === queueItem.data.hash && item.filetype === queueItem.data.filetype)
if (checkFile?.url) {
// File is already uploaded, just process the callback
status.setMessage(`Uploading attachment ${count++} of ${this.uploadQueue.length}...`)
// status.setMessage(`Uploading attachment ${count++} of ${this.uploadQueue.length}...`)
queueItem.callback(checkFile.url)
} else {
// File needs to be uploaded
promises.push(new Promise(resolve => {
this.postRaw('/v1/file/upload', queueItem.data)
.then((res) => {
// Process the callback
status.setMessage(`Uploading attachment ${count++} of ${this.uploadQueue.length}...`)
// status.setMessage(`Uploading attachment ${count++} of ${this.uploadQueue.length}...`)
queueItem.callback(res.url)
resolve()
})
Expand Down

0 comments on commit ab89cc3

Please sign in to comment.