diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-25 17:25:56 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-25 17:25:56 -0500 |
| commit | eade263f70cf957a95dc5f20b82105cc8eae94fc (patch) | |
| tree | 31e94d4580873adbb5af79c5a8dbe29a1495cf66 | |
| parent | 6f23f8814f996c1ceb9fd6f1e4f08bd29c37e797 (diff) | |
| download | slskd-eade263f70cf957a95dc5f20b82105cc8eae94fc.tar.gz | |
stop logs hub when component unmounts
| -rw-r--r-- | src/web/src/components/System/Logs/Live.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/web/src/components/System/Logs/Live.jsx b/src/web/src/components/System/Logs/Live.jsx index 2699a2e3..c572b2f9 100644 --- a/src/web/src/components/System/Logs/Live.jsx +++ b/src/web/src/components/System/Logs/Live.jsx @@ -20,6 +20,7 @@ class Live extends Component { componentDidMount() { const logsHub = createLogsHubConnection(); + this.logsHub = logsHub; logsHub.on('buffer', (buffer) => { this.setState({ @@ -44,6 +45,10 @@ class Live extends Component { logsHub.start(); } + componentWillUnmount() { + this.logsHub?.stop(); + } + nextId = 0; withId = (log) => ({ ...log, id: this.nextId++ }); |
