mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-07 18:45:09 +00:00
Overall progress bar turns red on download fail
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<a *ngIf="downloading" class="item right" (click)="showDownloads()">
|
<a *ngIf="downloading" class="item right" (click)="showDownloads()">
|
||||||
<div #progressBar appProgressBar [percent]="percent" class="ui progress">
|
<div #progressBar appProgressBar [percent]="percent" class="ui progress" [style.background-color]="error ? 'indianred' : undefined">
|
||||||
<div class="bar">
|
<div class="bar">
|
||||||
<div class="progress"></div>
|
<div class="progress"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export class StatusBarComponent {
|
|||||||
|
|
||||||
resultCount = 0
|
resultCount = 0
|
||||||
downloading = false
|
downloading = false
|
||||||
|
error = false
|
||||||
percent = 0
|
percent = 0
|
||||||
batchResults: VersionResult[]
|
batchResults: VersionResult[]
|
||||||
chartGroups: VersionResult[][]
|
chartGroups: VersionResult[][]
|
||||||
@@ -30,6 +31,7 @@ export class StatusBarComponent {
|
|||||||
setTimeout(() => { // Make sure this is the last callback executed to get the accurate downloadCount
|
setTimeout(() => { // Make sure this is the last callback executed to get the accurate downloadCount
|
||||||
this.downloading = downloadService.downloadCount > 0
|
this.downloading = downloadService.downloadCount > 0
|
||||||
this.percent = downloadService.totalPercent
|
this.percent = downloadService.totalPercent
|
||||||
|
this.error = downloadService.anyErrorsExist
|
||||||
ref.detectChanges()
|
ref.detectChanges()
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ export class DownloadService {
|
|||||||
return total / this.downloads.length
|
return total / this.downloads.length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get anyErrorsExist() {
|
||||||
|
return this.downloads.find(download => download.type == 'error') ? true : false
|
||||||
|
}
|
||||||
|
|
||||||
addDownload(versionID: number, newDownload: NewDownload) {
|
addDownload(versionID: number, newDownload: NewDownload) {
|
||||||
if (!this.downloads.find(download => download.versionID == versionID)) { // Don't download something twice
|
if (!this.downloads.find(download => download.versionID == versionID)) { // Don't download something twice
|
||||||
this.electronService.receiveIPC('download-updated', result => {
|
this.electronService.receiveIPC('download-updated', result => {
|
||||||
|
|||||||
Reference in New Issue
Block a user