fix(conn): updateConnectionUi 判离线时同步清空运行指标

This commit is contained in:
cbb
2026-09-16 20:47:57 +08:00
parent 91a534514d
commit b3a3a365bb
+5
View File
@@ -69,6 +69,11 @@ export function updateConnectionUi(connected, text) {
}
} catch (_) {}
var label = text || (connected ? '已连接' : '未连接');
/* 判离线立刻清实时指标:只改灯不等于清数据,否则 APP/缓存下会
* 出现「离线 + 温度/电压仍显示」的假活状态。 */
if (!connected && typeof window.clearLiveMetricsOnDisconnect === 'function') {
try { window.clearLiveMetricsOnDisconnect(); } catch (_) {}
}
// 仅顶栏连接胶囊(下方连接卡不再重复显示文案)
var pc = getEl('pillConn');
var pct = getEl('pillConnTxt');