diff --git a/docker/frontend/src/Library.tsx b/docker/frontend/src/Library.tsx index a6e61f1..5f7e698 100644 --- a/docker/frontend/src/Library.tsx +++ b/docker/frontend/src/Library.tsx @@ -519,7 +519,17 @@ function Catalogue() { if (pendingRows.length > 0) { const toAdd = pendingRows; pendingRows = []; - setPhotos((prev) => [...prev, ...toAdd]); + // A frame handed over the side is a frame the read-back that landed beside + // it already carries: a reading this window holds ends, the screen reads + // the catalogue back, and the rows it was handed are still waiting out + // their half second — so the same frame arrives twice and the header + // counts it twice. The id is the frame, so one of it in the strip is + // enough. + setPhotos((prev) => { + const have = new Set(prev.map((p) => p.id)); + const landed = toAdd.filter((p) => !have.has(p.id)); + return landed.length ? [...prev, ...landed] : prev; + }); } updateTimer = null; };