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:
parent
66e70d3d56
commit
741469e88e
1 changed files with 5 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue