mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-04-27 16:25:12 +00:00
Preserve expanded group rows across live refresh
Re-fetch children for expanded groups after loadPackets rebuilds the packet array, so expanded rows don't collapse on WS refresh.
This commit is contained in:
@@ -148,6 +148,22 @@
|
||||
}
|
||||
if (allHops.size) await resolveHops([...allHops]);
|
||||
|
||||
// Restore expanded group children
|
||||
if (groupByHash && expandedHashes.size > 0) {
|
||||
for (const hash of expandedHashes) {
|
||||
const group = packets.find(p => p.hash === hash);
|
||||
if (group) {
|
||||
try {
|
||||
const childData = await api(`/packets?hash=${hash}&limit=20`);
|
||||
group._children = childData.packets || [];
|
||||
} catch {}
|
||||
} else {
|
||||
// Group no longer in results — remove from expanded
|
||||
expandedHashes.delete(hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderLeft();
|
||||
} catch (e) {
|
||||
console.error('Failed to load packets:', e);
|
||||
|
||||
Reference in New Issue
Block a user