From 6c8e3f8c6246f97b2706de4c472fc6c4f5c8ee43 Mon Sep 17 00:00:00 2001 From: Shruti Gupta Date: Tue, 7 Jul 2026 13:32:34 +0530 Subject: [PATCH] Fix threat confidence display for safe messages --- chat.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chat.js b/chat.js index 82c3dc1..ed348ef 100644 --- a/chat.js +++ b/chat.js @@ -175,7 +175,12 @@ function appendAnalysisReport(report) { if (!historyDiv) return; const classification = report.classification || 'safe'; + const confidence = report.confidence ?? 0; + const threatConfidence = + classification === 'safe' + ? 0 + : confidence; const categories = { phishing: '🎣 Phishing / Credential Theft', fake_job: '💼 Fake Job Offer', @@ -197,10 +202,10 @@ function appendAnalysisReport(report) {
Threat Confidence - ${report.confidence || 0}% + ${threatConfidence}%
-
+