Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Enable sharing for home-screen Memory Lanes

ashil-pilot2e3e6bb5b26a
diff --git a/mobile/apps/photos/changes/memory-lane-sharing.md b/mobile/apps/photos/changes/memory-lane-sharing.md
new file mode 100644
index 0000000000..fa9d2b390e
--- /dev/null
+++ b/mobile/apps/photos/changes/memory-lane-sharing.md
@@ -0,0 +1 @@
+- Added sharing for Memory Lanes opened from the home screen.
diff --git a/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page_v2.dart b/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page_v2.dart
index 43761d11b7..03a8031863 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page_v2.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page_v2.dart
@@ -568,8 +568,7 @@ class _MemoryLanePageV2State extends State<MemoryLanePageV2> {
),
),
actions: [
- if (widget.person != null &&
- flagService.enableMemoryShareLink &&
+ if (flagService.enableMemoryShareLink &&
!isLocalGalleryMode)
// TODO: Replace with an Ente component when it supports this pressed overlay.
SizedBox.square(
@@ -817,13 +816,12 @@ class _MemoryLanePageV2State extends State<MemoryLanePageV2> {
if (!flagService.enableMemoryShareLink ||
isLocalGalleryMode ||
timeline == null ||
- person == null ||
!timeline.isEligible ||
timeline.entries.isEmpty) {
return;
}
final l10n = context.strings;
- final name = person.data.name.trim();
+ final name = person?.data.name.trim() ?? "";
var title = l10n.facesTimelineAppBarTitle;
if (name.isNotEmpty) {
title = l10n.memoryLaneCardTitle(
@@ -839,9 +837,9 @@ class _MemoryLanePageV2State extends State<MemoryLanePageV2> {
.getOrCreateMemoryLaneLink(
entries: timeline.entries,
title: title,
- personId: person.remoteID,
- personName: person.data.name,
- birthDate: person.data.birthDate,
+ personId: person?.remoteID,
+ personName: person?.data.name,
+ birthDate: person?.data.birthDate,
);
await dialog.hide();
if (!mounted) return;