pre-refactor

This commit is contained in:
2026-06-17 03:41:08 +00:00
parent 318d7169f7
commit 687fa8f52f
19 changed files with 215 additions and 105 deletions
+2 -2
View File
@@ -8,7 +8,7 @@
* auto-refresh messages from the backend can trigger page reloads.
*/
import { setSubscribeFn } from './component.js';
import { setSubscribeFn, isComponentStateMounted } from './component.js';
const _wsSubs = new Map();
let _wsConn = null;
@@ -74,7 +74,7 @@ function handleMessage(msg) {
}
for (const s of _wsSubs.values()) {
if (s.unsubscribed) continue;
if (s.unsubscribed || !isComponentStateMounted(s.state)) continue;
if (s.topic === '*') {
s.loadFn(s.state);
} else if (topics.some(t => t === s.topic || t === '*')) {