mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Initial settings, download UI, various bugfixes
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { Injectable, EventEmitter } from '@angular/core'
|
||||
import { ElectronService } from './electron.service'
|
||||
import { Download, NewDownload } from '../../../electron/shared/interfaces/download.interface'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DownloadService {
|
||||
|
||||
constructor() { }
|
||||
private downloadUpdatedEmitter = new EventEmitter<Download>()
|
||||
|
||||
constructor(private electronService: ElectronService) { }
|
||||
|
||||
addDownload(newDownload: NewDownload) {
|
||||
this.electronService.receiveIPC('download-updated', result => {
|
||||
this.downloadUpdatedEmitter.emit(result)
|
||||
})
|
||||
this.electronService.sendIPC('add-download', newDownload)
|
||||
}
|
||||
|
||||
onDownloadUpdated(callback: (download: Download) => void) {
|
||||
this.downloadUpdatedEmitter.subscribe(callback)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user