Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] fix: show "Add new" album for "On ente" section only

Aman Raj Singh Mouryaf9711e09a1a1
diff --git a/mobile/lib/ui/collections/collection_list_page.dart b/mobile/lib/ui/collections/collection_list_page.dart
index 8d9d89d56b..7d3b1430a1 100644
--- a/mobile/lib/ui/collections/collection_list_page.dart
+++ b/mobile/lib/ui/collections/collection_list_page.dart
@@ -64,6 +64,8 @@ class _CollectionListPageState extends State<CollectionListPage> {
@override
Widget build(BuildContext context) {
+ final displayLimitCount =
+ (collections?.length ?? 0) + (widget.tag.isEmpty ? 1 : 0);
return Scaffold(
body: SafeArea(
child: CustomScrollView(
@@ -87,7 +89,7 @@ class _CollectionListPageState extends State<CollectionListPage> {
),
CollectionsFlexiGridViewWidget(
collections,
- displayLimitCount: (collections?.length ?? 0) + 1,
+ displayLimitCount: displayLimitCount,
tag: widget.tag,
),
],
diff --git a/mobile/lib/ui/collections/flex_grid_view.dart b/mobile/lib/ui/collections/flex_grid_view.dart
index c78f5882cd..4d244423b0 100644
--- a/mobile/lib/ui/collections/flex_grid_view.dart
+++ b/mobile/lib/ui/collections/flex_grid_view.dart
@@ -48,12 +48,14 @@ class CollectionsFlexiGridViewWidget extends StatelessWidget {
albumsCountInOneRow;
final List<Widget> displayItems = [];
- displayItems.add(
- NewAlbumIcon(
- height: sideOfThumbnail,
- width: sideOfThumbnail,
- ),
- );
+ if (tag.isEmpty) {
+ displayItems.add(
+ NewAlbumIcon(
+ height: sideOfThumbnail,
+ width: sideOfThumbnail,
+ ),
+ );
+ }
if (collections != null && collections!.isNotEmpty) {
for (int i = 0; i < collections!.length; i++) {