Prevent error message for rimraf

This commit is contained in:
Geomitron
2020-05-17 21:55:40 -04:00
parent 34fe405fac
commit b9e1d61529
5 changed files with 6 additions and 9 deletions

View File

@@ -46,7 +46,6 @@ export class DownloadsModalComponent {
switch (download.type) {
case 'good': return 'unset'
case 'done': return 'unset'
case 'warning': return 'yellow'
case 'error': return 'indianred'
}
}

View File

@@ -87,7 +87,9 @@ export class ChartDownload {
const cancelFn = this.cancelFn
this.cancelFn = undefined
cancelFn()
try {
rimraf(this.chartPath) // Delete temp folder
} catch (e) { /** Do nothing */ }
}
}

View File

@@ -68,7 +68,7 @@ class DownloadHandler implements IPCEmitHandler<'download'> {
private startNextDownload() {
if (!this.downloadQueue.isEmpty()) {
this.currentDownload = this.downloadQueue.pop()
this.currentDownload = this.downloadQueue.shift()
if (this.currentDownload.hasFailed) {
this.currentDownload.retry()
} else {

View File

@@ -15,7 +15,7 @@ export class DownloadQueue {
this.sort()
}
pop() {
shift() {
return this.downloadQueue.shift()
}

View File

@@ -31,8 +31,4 @@ export interface DownloadProgress {
type: ProgressType
}
export type ProgressType = 'good' | 'warning' | 'error' | 'cancel' | 'done' | 'fastUpdate'
// export function downloadSorter(p1: DownloadProgress, p2: DownloadProgress) {
// return 0
// // return p1 - p2 // negative if p1 < p2
// }
export type ProgressType = 'good' | 'error' | 'cancel' | 'done' | 'fastUpdate'