Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Replace email with name if available on ShareCollectionPage

ashilkne0b9b27537f7
diff --git a/mobile/lib/ui/sharing/share_collection_page.dart b/mobile/lib/ui/sharing/share_collection_page.dart
index 26e19b33eb..42ba9f417c 100644
--- a/mobile/lib/ui/sharing/share_collection_page.dart
+++ b/mobile/lib/ui/sharing/share_collection_page.dart
@@ -2,6 +2,7 @@ import 'package:collection/collection.dart';
import 'package:fast_base58/fast_base58.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+import "package:photos/extensions/user_extension.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import 'package:photos/models/collection/collection.dart';
@@ -332,20 +333,21 @@ class EmailItemWidget extends StatelessWidget {
const EmailItemWidget(
this.collection, {
this.onTap,
- Key? key,
- }) : super(key: key);
+ super.key,
+ });
@override
Widget build(BuildContext context) {
if (collection.getSharees().isEmpty) {
return const SizedBox.shrink();
} else if (collection.getSharees().length == 1) {
+ final User? user = collection.getSharees().firstOrNull;
return Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
- title: collection.getSharees().firstOrNull?.email ?? '',
+ title: user?.displayName ?? user?.email ?? '',
),
leadingIconWidget: UserAvatarWidget(
collection.getSharees().first,