feat: market event
This commit is contained in:
@@ -436,6 +436,10 @@ function EventDetail({
|
||||
preds: latest.prediction_json || {},
|
||||
actuals: latest.actual_json || {},
|
||||
drift: driftByInst,
|
||||
pricesMode: undefined,
|
||||
lagMin: undefined,
|
||||
lagDays: undefined,
|
||||
lagDebug: undefined,
|
||||
})
|
||||
if (latest.graph_json?.nodes?.length) {
|
||||
setGraphData(latest.graph_json as GraphData)
|
||||
@@ -550,7 +554,7 @@ function EventDetail({
|
||||
})
|
||||
const d = await r.json()
|
||||
if (!r.ok) throw new Error(d.detail || r.statusText)
|
||||
setAnResult({
|
||||
const freshResult = {
|
||||
score: d.activation?.score ?? null,
|
||||
preds: d.node_values ?? {},
|
||||
actuals: d.actual_moves ?? {},
|
||||
@@ -559,9 +563,11 @@ function EventDetail({
|
||||
lagMin: d.effective_lag_min,
|
||||
lagDays: d.effective_lag_days,
|
||||
lagDebug: d.lag_debug,
|
||||
})
|
||||
}
|
||||
setAnResult(freshResult)
|
||||
if (d.graph_json?.nodes?.length) setGraphData(d.graph_json)
|
||||
await loadAnalyses()
|
||||
setAnResult(freshResult) // loadAnalyses() écrase anResult — on restaure le résultat frais
|
||||
} catch (e: any) { setAnResult({ score: null, preds: {}, actuals: {} }) }
|
||||
finally { setLoadingAn(false) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user