mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-03-04 05:55:56 +01:00
fix: fix svelte js race condition on metric selection change, see #335
- only dispatch new data to statsTable on 'load-all'
This commit is contained in:
parent
f7a67c72bf
commit
1b043838ea
@ -148,16 +148,17 @@
|
|||||||
zoomState = {...pendingZoomState}
|
zoomState = {...pendingZoomState}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set selected scope to min of returned scopes
|
// On additional scope request
|
||||||
if (selectedScope == "load-all") {
|
if (selectedScope == "load-all") {
|
||||||
selectedScope = minScope(scopes)
|
// Push scope to statsTable (Needs to be in this case, else newly selected 'Metric.svelte' renders cause statsTable race condition)
|
||||||
nodeOnly = (selectedScope == "node") // "node" still only scope after load-all
|
|
||||||
}
|
|
||||||
|
|
||||||
const statsTableData = $metricData.data.singleUpdate.filter((x) => x.scope !== "node")
|
const statsTableData = $metricData.data.singleUpdate.filter((x) => x.scope !== "node")
|
||||||
if (statsTableData.length > 0) {
|
if (statsTableData.length > 0) {
|
||||||
dispatch("more-loaded", statsTableData);
|
dispatch("more-loaded", statsTableData);
|
||||||
}
|
}
|
||||||
|
// Set selected scope to min of returned scopes
|
||||||
|
selectedScope = minScope(scopes)
|
||||||
|
nodeOnly = (selectedScope == "node") // "node" still only scope after load-all
|
||||||
|
}
|
||||||
|
|
||||||
patternMatches = statsPattern.exec(selectedScope)
|
patternMatches = statsPattern.exec(selectedScope)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user