fix(ui): show correct P2P Direct / Via Relay badge

The UI looked for event "connect:dual_path_race_won" which doesn't
exist — the actual event is "connect:path_negotiated" with a
use_direct boolean. Badge always showed "Via Relay" even when the
call was direct P2P.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-12 13:22:00 +04:00
parent 0b62d3e22f
commit 7554959baa

View File

@@ -1015,10 +1015,10 @@ async function pollStatus() {
if (directCallPeer) {
// Check the debug buffer for the race result to label
// the connection type (P2P Direct vs Relay).
const raceWon = callDebugBuffer.find((e) => e.step === "connect:dual_path_race_won");
const pathNeg = callDebugBuffer.find((e) => e.step === "connect:path_negotiated");
const engineOk = callDebugBuffer.find((e) => e.step === "connect:call_engine_started");
if (engineOk) {
if (raceWon?.details?.path === "Direct") {
if (pathNeg?.details?.use_direct === true) {
dcBadge.textContent = "P2P Direct";
dcBadge.className = "dc-badge";
} else {