mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
StatusBar and Sidebar views update correctly
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { Component, ChangeDetectorRef } from '@angular/core'
|
||||
import { SongResult } from 'src/electron/shared/interfaces/search.interface'
|
||||
import { DownloadService } from 'src/app/core/services/download.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-status-bar',
|
||||
@@ -7,9 +9,18 @@ import { Component } from '@angular/core'
|
||||
})
|
||||
export class StatusBarComponent {
|
||||
|
||||
resultCount = 0
|
||||
downloading = false
|
||||
percent = 0
|
||||
selectedResults: SongResult[] = []
|
||||
|
||||
constructor() { }
|
||||
constructor(downloadService: DownloadService, ref: ChangeDetectorRef) {
|
||||
downloadService.onDownloadUpdated(() => {
|
||||
this.downloading = downloadService.downloadCount > 0
|
||||
this.percent = downloadService.totalPercent
|
||||
ref.detectChanges()
|
||||
})
|
||||
}
|
||||
|
||||
showDownloads() {
|
||||
$('#downloadsModal').modal('show')
|
||||
|
||||
Reference in New Issue
Block a user