1
0
Fork 0

fix(voiceover): scope script submission counts per script

listScriptsForUser passes all submissions at once, so a take on one
script was being counted under every script's card. Skip submissions
whose script id doesn't match the card being rendered so each count stays
scoped to its own script.
This commit is contained in:
Jason Fraley 2026-10-09 13:13:19 -04:00
parent 66e70d3d56
commit 741469e88e

View file

@ -58,6 +58,11 @@ function buildScriptView(
let otherSubmissionCount = 0;
for (const submission of submissions) {
// depth: 0 — `script` is a numeric id here. Scope every count to this
// script so a submission on one script never bleeds onto another's card.
// `listScriptsForUser` passes ALL submissions at once, so without this a
// single take surfaces under every script (a prod display bug).
if (submission.script !== script.id) continue;
if (submission.user === userId) {
mySubmissions.push(toSubmissionSummary(submission));
} else {