Skip to content

Commit c581eac

Browse files
Fixed the way the close ups are displayed in VM (#694)
1 parent a3d3d61 commit c581eac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/inspection-report/src/components/DamageReport/hooks/useProcessInspection.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ function getPictures(inspection) {
8181
}
8282

8383
function getPartPictures(part, inspection) {
84-
const closeUps = inspection.images.filter((image) => (
85-
image.image_type === 'close_up'
86-
&& image.detailed_viewpoint?.centers_on.includes(part.part_type)
87-
));
84+
const closeUpImageIds = inspection.parts
85+
.find((value) => value.part_type === part.part_type)
86+
?.related_images.filter((image) => image.base_image_type === 'close_up')
87+
.map((image) => image.base_image_type);
88+
const closeUps = inspection.images
89+
.filter((image) => closeUpImageIds.includes(image.base_image_id));
8890
const beautyShotsWithDamages = inspection.images.filter((image) => (
8991
image.image_type === 'beauty_shot'
9092
&& image.views?.some((view) => view.element_id === part.id)

0 commit comments

Comments
 (0)