Skip to content

armgit / ente

Public Imported from GitHub
0

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

Test 1

Manav Rathi55a86cc85c1b
diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx
index 5c50233f21..6ceab7e790 100644
--- a/web/apps/photos/src/components/PhotoViewer/index.tsx
+++ b/web/apps/photos/src/components/PhotoViewer/index.tsx
@@ -107,10 +107,13 @@ function PhotoViewer(props: Iprops) {
useState<Photoswipe<Photoswipe.Options>>();
const [isFav, setIsFav] = useState(false);
const [showInfo, setShowInfo] = useState(false);
- const [exif, setExif] = useState<{
- key: string;
- value: FileInfoExif | undefined;
- }>();
+ const [exif, setExif] = useState<
+ | {
+ key: string;
+ value: FileInfoExif | undefined;
+ }
+ | undefined
+ >();
const exifCopy = useRef(null);
const [livePhotoBtnOptions, setLivePhotoBtnOptions] = useState(
defaultLivePhotoDefaultOptions,
@@ -309,13 +312,10 @@ function PhotoViewer(props: Iprops) {
setExif({ key: file.src, value: undefined });
return;
}
- if (!file.isSourceLoaded || file.conversionFailed) {
+ if (!file || !file.isSourceLoaded || file.conversionFailed) {
return;
}
- if (!file || !exifCopy?.current?.value) {
- return;
- }
const key =
file.metadata.fileType === FILE_TYPE.IMAGE
? file.src