Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] use unnamed captions for clusters

Priyanshu Dangare81a2cbf24248
diff --git a/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart b/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart
index e7f751a386..733258256e 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/memory_lane_page.dart
@@ -934,10 +934,11 @@ class _MemoryLanePageState extends State<MemoryLanePage>
final double slotWidth = samplePainter.width;
final double slotHeight = samplePainter.height;
final String formattedCurrent = numberFormat.format(currentRounded);
+ final person = widget.person;
String fullText;
- if (captionType == _CaptionType.age) {
+ if (captionType == _CaptionType.age && person != null) {
fullText = l10n.facesTimelineCaptionYearsOld(
- name: widget.person?.data.name ?? "",
+ name: person.data.name,
count: currentRounded,
);
} else {
@@ -945,9 +946,8 @@ class _MemoryLanePageState extends State<MemoryLanePage>
if (fullText.contains("#")) {
fullText = fullText.replaceAll("#", formattedCurrent);
}
- final String name = widget.person?.data.name ?? "";
- if (name.isNotEmpty) {
- fullText = "$name $fullText";
+ if (person != null && person.data.name.isNotEmpty) {
+ fullText = "${person.data.name} $fullText";
}
}
final int insertionIndex = fullText.indexOf(formattedCurrent);