fix: convert 0-1 scale confidence to percent in timeline-card (same bug as classification-card, missed in 260716-pgr)
This commit is contained in:
parent
952b63c8a4
commit
ec6c5d05e6
1 changed files with 2 additions and 1 deletions
|
|
@ -51,7 +51,8 @@ function renderEntry(entry: TimelineEntry): {
|
|||
}
|
||||
|
||||
if (entry.kind === 'classification') {
|
||||
const confidence = entry.confidence != null ? ` (${entry.confidence}%)` : '';
|
||||
const confidencePct = entry.confidence != null ? Number(entry.confidence) : NaN;
|
||||
const confidence = Number.isFinite(confidencePct) ? ` (${Math.round(confidencePct * 100)}%)` : '';
|
||||
// Defensive fallback: phishing-timeline.ts emits verdict as a plain
|
||||
// unvalidated runtime `string`, so a value outside this component's
|
||||
// narrowed union must never crash the render (T-23-12).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue