Skip to content

Commit

Permalink
fix: display all language for selected images
Browse files Browse the repository at this point in the history
  • Loading branch information
Valimp committed Sep 2, 2024
1 parent 713ca27 commit 3923c3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/InfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import axios from 'axios';
import PreviewOutlinedIcon from '@mui/icons-material/PreviewOutlined';
import Grid from '@mui/material/Unstable_Grid2';
import Accordion from '@mui/material/Accordion';
import AccordionActions from '@mui/material/AccordionActions';
import AccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
Expand Down Expand Up @@ -72,8 +71,12 @@ export default function ModalInfo({barcode}: ModalInfoProps) {
const selectedImages = res.data.product.selected_images;
if (selectedImages) {
for (const key in selectedImages) {
if (selectedImages[key].thumb && selectedImages[key].thumb.en) {
usedData.selectedImages.push(selectedImages[key].thumb.en);
if (selectedImages[key].thumb ) {
for (const lang in selectedImages[key].thumb) {
if (selectedImages[key].thumb[lang]) {
usedData.selectedImages.push(selectedImages[key].thumb[lang]);
}
}
}
}
}
Expand Down

0 comments on commit 3923c3a

Please sign in to comment.