From e0a1c033cf79a5d83f0e0cbed00a3d47b26d37fa Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 19 Apr 2026 18:51:12 -0400 Subject: [PATCH] fix: freeze PP clock during intermission so it stops ticking toward zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tickClocks iterates every [data-seconds][data-received-at] element. Rendering the PP indicator with those attrs during an intermission made the clock bleed seconds even though play is paused and the penalty isn't running. Drop the ticking attrs when game['Intermission'] is true — render a plain static "PP MM:SS" that resumes ticking on the next live payload. Co-Authored-By: Claude Opus 4.7 --- app/static/script.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/static/script.js b/app/static/script.js index 9282d56..468719d 100644 --- a/app/static/script.js +++ b/app/static/script.js @@ -244,7 +244,9 @@ function teamRow(game, side, state) { const sogHtml = (state === 'live' || state === 'final') && sog !== undefined ? `${sog} SOG` : ''; - const ppHtml = state === 'live' && pp ? teamPpIndicator(pp) : ''; + const ppHtml = state === 'live' && pp + ? teamPpIndicator(pp, game['Intermission']) + : ''; const subParts = [sogHtml, ppHtml].filter(Boolean).join(''); const subline = subParts ? `
${subParts}
` : ''; @@ -264,8 +266,11 @@ function teamRow(game, side, state) { `; } -function teamPpIndicator(pp) { +function teamPpIndicator(pp, intermission) { const timeStr = pp.replace('PP ', ''); + if (intermission) { + return `PP ${timeStr}`; + } const seconds = timeToSeconds(timeStr); const attrs = `data-seconds="${seconds}" data-received-at="${Date.now()}" data-pp-clock`; return `PP ${timeStr}`;