()
| 425 | } |
| 426 | |
| 427 | async stop() { |
| 428 | if (this.status == "stopped") return; |
| 429 | this.status = "stopped"; |
| 430 | for (const task of this.task) { |
| 431 | if (!task) continue; |
| 432 | if (task.status !== "completed") { |
| 433 | task.stop(); |
| 434 | } |
| 435 | } |
| 436 | this.task = []; |
| 437 | this.current = undefined; |
| 438 | const stopTask: Promise<any>[] = []; |
| 439 | for (const file of this.files) { |
| 440 | stopTask.push(file[1].stop()); |
| 441 | } |
| 442 | await Promise.all(stopTask); |
| 443 | this.files.clear(); |
| 444 | this.uploaded = 0; |
| 445 | this.updateProgress(); |
| 446 | } |
| 447 | |
| 448 | updateProgress() { |
| 449 | if (!this.current) { |
nothing calls this directly
no test coverage detected