fix(venue-crowd): don't let null accuracy resets wipe the end-of-song value

Codex preflight: Number(null) is 0, so idle HUD resets overwrote
_lastAccuracyPct before stats:recorded consumed it, suppressing the
end-of-song stinger.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
byrongamatos
2026-07-12 21:03:48 +02:00
co-authored by Claude Fable 5
parent be78b4f29e
commit f362c9a083
+5 -1
View File
@@ -322,7 +322,11 @@
if (!_venueActive || !_manifest) return;
bindVideosToRenderer();
const d = (e && e.detail) || {};
if (Number.isFinite(Number(d.accuracyPct))) _lastAccuracyPct = Number(d.accuracyPct);
// Number(null) === 0: HUD reset events (accuracyPct: null) must not
// wipe the value the end-of-song stinger reads via stats:recorded.
if (d.accuracyPct != null && Number.isFinite(Number(d.accuracyPct))) {
_lastAccuracyPct = Number(d.accuracyPct);
}
const streak = Number(d.streak) || 0;
const sting = stingerForStreak(_prevStreak, streak);
_prevStreak = streak;