Skip to content

Commit

Permalink
fix(web): show one face for the same person in the detail panel (immi…
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal authored Nov 3, 2023
1 parent 330f4ca commit e1e45f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/src/domain/asset/response-dto/asset-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ export function mapAsset(entity: AssetEntity, options: AssetMapOptions = {}): As
tags: entity.tags?.map(mapTag),
people: entity.faces
?.map(mapFace)
.filter((person): person is PersonResponseDto => person !== null && !person.isHidden),
.filter((person): person is PersonResponseDto => person !== null && !person.isHidden)
.reduce((people, person) => {
const existingPerson = people.find((p) => p.id === person.id);
if (!existingPerson) {
people.push(person);
}
return people;
}, [] as PersonResponseDto[]),
checksum: entity.checksum.toString('base64'),
stackParentId: entity.stackParentId,
stack: withStack ? entity.stack?.map((a) => mapAsset(a, { stripMetadata })) ?? undefined : undefined,
Expand Down

0 comments on commit e1e45f3

Please sign in to comment.