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:
@@ -1015,10 +1015,10 @@ async function pollStatus() {
|
|||||||
if (directCallPeer) {
|
if (directCallPeer) {
|
||||||
// Check the debug buffer for the race result to label
|
// Check the debug buffer for the race result to label
|
||||||
// the connection type (P2P Direct vs Relay).
|
// 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");
|
const engineOk = callDebugBuffer.find((e) => e.step === "connect:call_engine_started");
|
||||||
if (engineOk) {
|
if (engineOk) {
|
||||||
if (raceWon?.details?.path === "Direct") {
|
if (pathNeg?.details?.use_direct === true) {
|
||||||
dcBadge.textContent = "P2P Direct";
|
dcBadge.textContent = "P2P Direct";
|
||||||
dcBadge.className = "dc-badge";
|
dcBadge.className = "dc-badge";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user