diff --git a/docker/frontend/src/App.tsx b/docker/frontend/src/App.tsx index 81b6b9f..474aec0 100644 --- a/docker/frontend/src/App.tsx +++ b/docker/frontend/src/App.tsx @@ -761,11 +761,17 @@ export function Workspace() { loadPhoto() .then(async (photo) => { if (!alive) return; - if (photo) { - return adoptPhoto(photo.bytes, photo.name, new Blob([photo.bytes as BlobPart], { type: 'image/jpeg' }), true); - } + const show = (row: { name: string; bytes: Uint8Array }) => + adoptPhoto(row.bytes, row.name, new Blob([row.bytes as BlobPart], { type: 'image/jpeg' }), true); + // A session photo named like a RAW is a develop an older build left + // there — the RAW branch writes none any more — and it carries that + // build's colour, which is how a fixed develop kept opening olive. The + // parked RAW is the copy that is not stale, so it is read first; the + // session's is only shown when nothing is parked to develop. + if (photo && !isRawName(photo.name)) return show(photo); const parked = await readRaw(); - if (!alive || !parked) return; + if (!alive) return; + if (!parked) return photo ? show(photo) : undefined; const jpeg = await developRaw(parked.bytes); await adoptPhoto(jpeg, parked.name, new Blob([jpeg as BlobPart], { type: 'image/jpeg' }), true, parked.bytes); })