Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix warnings on opening drawer

Manav Rathieb7611a6d17d
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx
index 3e1a3f49bd..c6c0582f8e 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/ExifData.tsx
@@ -3,6 +3,7 @@ import { formatDateTimeFull } from "@ente/shared/time/format";
import { Box, Stack, styled, Typography } from "@mui/material";
import Titlebar from "components/Titlebar";
import { t } from "i18next";
+import React from "react";
import { FileInfoSidebar } from ".";
const ExifItem = styled(Box)`
@@ -84,7 +85,7 @@ export function ExifData(props: {
</Typography>
</ExifItem>
) : (
- <></>
+ <React.Fragment key={key}></React.Fragment>
),
)}
</Stack>
diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/InfoItem.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/InfoItem.tsx
index 3cc9f5d35c..061b1dcac2 100644
--- a/web/apps/photos/src/components/PhotoViewer/FileInfo/InfoItem.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/InfoItem.tsx
@@ -42,9 +42,19 @@ export default function InfoItem({
<Typography sx={{ wordBreak: "break-all" }}>
{title}
</Typography>
- <Typography variant="small" color="text.muted">
- {caption}
- </Typography>
+ {!caption || typeof caption == "string" ? (
+ <Typography variant="small" color="text.muted">
+ {caption}
+ </Typography>
+ ) : (
+ <Typography
+ variant="small"
+ component="div"
+ color="text.muted"
+ >
+ {caption}
+ </Typography>
+ )}
</>
)}
</Box>