Propagate configuration on load via downloads socket

This commit is contained in:
James Woglom
2022-08-29 20:27:34 -04:00
parent bbfde99aeb
commit 4a9f55adda
4 changed files with 24 additions and 14 deletions

View File

@@ -33,6 +33,7 @@ export class DownloadsService {
done = new Map<string, Download>();
queueChanged = new Subject();
doneChanged = new Subject();
configuration = {};
constructor(private http: HttpClient, private socket: MeTubeSocket) {
socket.fromEvent('all').subscribe((strdata: string) => {
@@ -74,6 +75,11 @@ export class DownloadsService {
this.done.delete(data);
this.doneChanged.next(null);
});
socket.fromEvent('configuration').subscribe((strdata: string) => {
let data: string = JSON.parse(strdata);
console.debug("got configuration:", data);
this.configuration = data;
})
}
handleHTTPError(error: HttpErrorResponse) {