Skip to content

armgit / ente

Public Imported from GitHub
0

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

chore: remove unnecessary code change from gallery and misc fixes

anandbaburajanba8a257cb1c8
diff --git a/web/apps/photos/src/components/TripTemplate/MobileTripStarted.tsx b/web/apps/photos/src/components/TripTemplate/MobileTripStarted.tsx
index ce7036b9e6..d6fea46ebc 100644
--- a/web/apps/photos/src/components/TripTemplate/MobileTripStarted.tsx
+++ b/web/apps/photos/src/components/TripTemplate/MobileTripStarted.tsx
@@ -79,7 +79,7 @@ const MobileTripStartedLine = styled(Box)(({ theme }) => ({
width: "3px",
backgroundColor: theme.palette.grey[300],
transform: "translateX(-1.5px)",
- zIndex: 1,
+ zIndex: 0,
}));
const TripStartedTitle = styled("span")(({ theme }) => ({
diff --git a/web/apps/photos/src/components/TripTemplate/utils/scrollUtils.ts b/web/apps/photos/src/components/TripTemplate/utils/scrollUtils.ts
index 87de5867f1..772d67da3e 100644
--- a/web/apps/photos/src/components/TripTemplate/utils/scrollUtils.ts
+++ b/web/apps/photos/src/components/TripTemplate/utils/scrollUtils.ts
@@ -157,38 +157,44 @@ export const handleTimelineScroll = ({
const targetZoom = isMobile ? 8 : 10; // Mobile-aware zoom level
- if (isDistantLocation) {
- // For distant locations: zoom out β†’ pan β†’ zoom in
- const intermediateZoom = isMobile ? 2 : 4;
- mapRef.flyTo([positionedLat, positionedLng], intermediateZoom, {
- animate: true,
- duration: 1.5,
- easeLinearity: 0.25,
- });
-
- setTimeout(() => {
- mapRef.flyTo([positionedLat, positionedLng], targetZoom, {
+ try {
+ if (isDistantLocation) {
+ // For distant locations: zoom out β†’ pan β†’ zoom in
+ const intermediateZoom = isMobile ? 2 : 4;
+ mapRef.flyTo([positionedLat, positionedLng], intermediateZoom, {
animate: true,
- duration: 1.2,
+ duration: 1.5,
easeLinearity: 0.25,
});
- }, 1600);
- } else {
- // For nearby locations: simple pan to target location
- const currentMapZoom = mapRef.getZoom();
- if (Math.abs(currentMapZoom - targetZoom) > 0.5) {
- mapRef.flyTo([positionedLat, positionedLng], targetZoom, {
- animate: true,
- duration: 0.8,
- easeLinearity: 0.3,
- });
+
+ setTimeout(() => {
+ if (mapRef && mapRef.getContainer()) {
+ mapRef.flyTo([positionedLat, positionedLng], targetZoom, {
+ animate: true,
+ duration: 1.2,
+ easeLinearity: 0.25,
+ });
+ }
+ }, 1600);
} else {
- mapRef.panTo([positionedLat, positionedLng], {
- animate: true,
- duration: 0.8,
- easeLinearity: 0.3,
- });
+ // For nearby locations: simple pan to target location
+ const currentMapZoom = mapRef.getZoom();
+ if (Math.abs(currentMapZoom - targetZoom) > 0.5) {
+ mapRef.flyTo([positionedLat, positionedLng], targetZoom, {
+ animate: true,
+ duration: 0.8,
+ easeLinearity: 0.3,
+ });
+ } else {
+ mapRef.panTo([positionedLat, positionedLng], {
+ animate: true,
+ duration: 0.8,
+ easeLinearity: 0.3,
+ });
+ }
}
+ } catch (error) {
+ console.warn("Map operation failed:", error);
}
}
};
@@ -273,12 +279,16 @@ export const handleMarkerClick = ({
);
if (mapRef && mapRef.getContainer()) {
- const targetZoom = isMobile ? 8 : 10; // Mobile-aware zoom level
- mapRef.flyTo([positionedLat, positionedLng], targetZoom, {
- animate: true,
- duration: 1.0,
- easeLinearity: 0.3,
- });
+ try {
+ const targetZoom = isMobile ? 8 : 10; // Mobile-aware zoom level
+ mapRef.flyTo([positionedLat, positionedLng], targetZoom, {
+ animate: true,
+ duration: 1.0,
+ easeLinearity: 0.3,
+ });
+ } catch (error) {
+ console.warn("Map operation failed:", error);
+ }
}
setTimeout(() => {
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 0949ece55e..635b9c303d 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -1029,8 +1029,6 @@ const Page: React.FC = () => {
mb: "12px",
px: "24px",
"@media (width < 720px)": { px: "4px" },
- opacity: isFileViewerOpen ? 0 : 1,
- pointerEvents: isFileViewerOpen ? "none" : "auto",
},
showSelectionBar && { borderColor: "accent.main" },
]}