From e606501834347f350a11530c939e28fee00cd12b Mon Sep 17 00:00:00 2001 From: destrodxbad Date: Fri, 14 Nov 2025 20:29:38 +0100 Subject: [PATCH] Fix: Refresh disk space notification during pause and after reconnection --- client/src/app/torrent.service.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/app/torrent.service.ts b/client/src/app/torrent.service.ts index 268f548..8ecd2f0 100644 --- a/client/src/app/torrent.service.ts +++ b/client/src/app/torrent.service.ts @@ -31,7 +31,6 @@ export class TorrentService { .withUrl(`${this.baseHref}hub`) .withAutomaticReconnect() .build(); - this.connection.start().catch((err) => console.error(err)); this.connection.on('update', (torrents: Torrent[]) => { this.update$.next(torrents); @@ -40,6 +39,18 @@ export class TorrentService { this.connection.on('diskSpaceStatus', (status: any) => { 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 {