Fix: Refresh disk space notification during pause and after reconnection
This commit is contained in:
parent
6db556ed5c
commit
e606501834
1 changed files with 12 additions and 1 deletions
|
|
@ -31,7 +31,6 @@ export class TorrentService {
|
||||||
.withUrl(`${this.baseHref}hub`)
|
.withUrl(`${this.baseHref}hub`)
|
||||||
.withAutomaticReconnect()
|
.withAutomaticReconnect()
|
||||||
.build();
|
.build();
|
||||||
this.connection.start().catch((err) => console.error(err));
|
|
||||||
|
|
||||||
this.connection.on('update', (torrents: Torrent[]) => {
|
this.connection.on('update', (torrents: Torrent[]) => {
|
||||||
this.update$.next(torrents);
|
this.update$.next(torrents);
|
||||||
|
|
@ -40,6 +39,18 @@ export class TorrentService {
|
||||||
this.connection.on('diskSpaceStatus', (status: any) => {
|
this.connection.on('diskSpaceStatus', (status: any) => {
|
||||||
this.diskSpaceStatus$.next(status);
|
this.diskSpaceStatus$.next(status);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.connection.onreconnected(() => {
|
||||||
|
this.getDiskSpaceStatus().subscribe({
|
||||||
|
next: (status) => {
|
||||||
|
if (status) {
|
||||||
|
this.diskSpaceStatus$.next(status);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.connection.start().catch((err) => console.error(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
public getList(): Observable<Torrent[]> {
|
public getList(): Observable<Torrent[]> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue