Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Hide file owner if file is a public shared file

Aman Raj Singh Mourya22737f139bf4
diff --git a/mobile/lib/services/collections_service.dart b/mobile/lib/services/collections_service.dart
index 385e1ae24a..ab08d43261 100644
--- a/mobile/lib/services/collections_service.dart
+++ b/mobile/lib/services/collections_service.dart
@@ -1128,7 +1128,7 @@ class CollectionsService {
return null;
}
- Future<bool> isPublicCollection(int collectionID) async {
+ bool isPublicCollection(int collectionID) {
return _cachedPublicCollectionID.contains(collectionID);
}
diff --git a/mobile/lib/ui/viewer/file_details/added_by_widget.dart b/mobile/lib/ui/viewer/file_details/added_by_widget.dart
index f1cbdc4aad..14090db503 100644
--- a/mobile/lib/ui/viewer/file_details/added_by_widget.dart
+++ b/mobile/lib/ui/viewer/file_details/added_by_widget.dart
@@ -15,6 +15,11 @@ class AddedByWidget extends StatelessWidget {
if (!file.isUploaded) {
return const SizedBox.shrink();
}
+ final bool isPublicFile =
+ CollectionsService.instance.isPublicCollection(file.collectionID!);
+ if (isPublicFile) {
+ return const SizedBox.shrink();
+ }
String? addedBy;
if (file.isOwner && file.isCollect) {
addedBy = file.uploaderName;