fix(mp): 二轮审计修复 — ScrollView嵌套/InputField重建/markdown分组/BLE上限/缓存清理
CRITICAL: ai-report/list PageShell scroll=false 修复双重滚动冲突 HIGH: dialysis/create InputField 提取为独立组件避免 render 销毁重建 MEDIUM: markdownToHtml 连续<li>合并到单个<ul> MEDIUM: 咨询详情页图片添加 lazyLoad MEDIUM: BLEManager readings 添加 MAX_LIVE_READINGS=200 上限 MEDIUM: DataBuffer trimToMax 时重建 seenKeys 保持一致性 MEDIUM: auth.ts logout 清理模块级缓存变量 LOW: request.ts safeReLaunch 添加 console.warn + doRefresh 死锁警告注释
This commit is contained in:
@@ -16,6 +16,8 @@ const DEFAULT_CONFIG: BLEManagerConfig = {
|
||||
retryCount: 3,
|
||||
};
|
||||
|
||||
const MAX_LIVE_READINGS = 200;
|
||||
|
||||
export class BLEManager {
|
||||
private adapters: DeviceAdapter[] = [];
|
||||
private connection: BLEConnection | null = null;
|
||||
@@ -193,7 +195,10 @@ export class BLEManager {
|
||||
res.value,
|
||||
);
|
||||
if (newReadings.length > 0) {
|
||||
this.readings = [...this.readings, ...newReadings];
|
||||
const combined = [...this.readings, ...newReadings];
|
||||
this.readings = combined.length > MAX_LIVE_READINGS
|
||||
? combined.slice(-MAX_LIVE_READINGS)
|
||||
: combined;
|
||||
this.dataBuffer.push(newReadings);
|
||||
this.onReadings?.(newReadings);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user