Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix trip layout mobile share to include album name

anandbaburajan5060bad767e7
diff --git a/web/apps/photos/src/components/TripLayout/MobileNavBar.tsx b/web/apps/photos/src/components/TripLayout/MobileNavBar.tsx
index d875e73694..330bee81ba 100644
--- a/web/apps/photos/src/components/TripLayout/MobileNavBar.tsx
+++ b/web/apps/photos/src/components/TripLayout/MobileNavBar.tsx
@@ -27,17 +27,18 @@ export const MobileNavBar: React.FC<MobileNavBarProps> = ({
const handleShare = async () => {
if (typeof window !== "undefined") {
+ const albumName = collectionTitle || "Trip";
+ const shareUrl = window.location.href;
+ const shareText = `${albumName}\n${shareUrl}`;
+
try {
- await navigator.share({
- title: collectionTitle || "Trip",
- url: window.location.href,
- });
+ await navigator.share({ text: shareText });
} catch (error) {
if (
!error ||
(error instanceof Error && error.name !== "AbortError")
) {
- void navigator.clipboard.writeText(window.location.href);
+ void navigator.clipboard.writeText(shareText);
setShowCopiedMessage(true);
setTimeout(() => setShowCopiedMessage(false), 2000);
}
diff --git a/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.ts b/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.ts
index 5c3bb189b3..db2833e6d5 100644
--- a/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.ts
+++ b/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.ts
@@ -28,8 +28,8 @@ export const useLocationFetching = ({
useEffect(() => {
// Create a stable key for current clusters to prevent duplicate fetches
const clustersKey = photoClusters
- .map(cluster => cluster.map(p => p.fileId).join(','))
- .join('|');
+ .map((cluster) => cluster.map((p) => p.fileId).join(","))
+ .join("|");
// Skip if we already fetched for these exact clusters
if (clustersKey === lastFetchedClustersRef.current) {