Initial settings, download UI, various bugfixes

This commit is contained in:
Geomitron
2020-02-09 21:15:40 -05:00
parent 89948b118b
commit de39ad4f1e
33 changed files with 1034 additions and 110 deletions

View File

@@ -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)
}
}