From 72c48e9fc405381ae25cfc4e78776dfdd3e087c1 Mon Sep 17 00:00:00 2001 From: Hamlet Jiang Su Date: Fri, 16 Jun 2023 09:31:14 -0700 Subject: [PATCH] fixed issue with loading indicator present on some communities with little posts --- CHANGELOG.md | 4 ++++ lib/community/bloc/community_bloc.dart | 2 +- lib/community/widgets/community_drawer.dart | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0febf134b..e096c5192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ ### Changed - Initial feed now shows a compact version of an image, rather than the full height image +### Fixed +- Fixed issue where if you log in with an instance that does not exist, the community page will indefinitely load +- Fixed issue where a community would show a loading indicator if there were too little posts within that community + ## 0.1.0-alpha - 2023-06-15 ### Added - Sorting post feed by hot, active, etc. diff --git a/lib/community/bloc/community_bloc.dart b/lib/community/bloc/community_bloc.dart index f075b4fd4..7435d7ff0 100644 --- a/lib/community/bloc/community_bloc.dart +++ b/lib/community/bloc/community_bloc.dart @@ -138,7 +138,7 @@ class CommunityBloc extends Bloc { postViews: posts, listingType: event.listingType ?? ListingType.Local, communityId: event.communityId, - hasReachedEnd: posts.isEmpty, + hasReachedEnd: posts.isEmpty || posts.length < 15, )); } else { if (state.hasReachedEnd) return emit(state.copyWith(status: CommunityStatus.success)); diff --git a/lib/community/widgets/community_drawer.dart b/lib/community/widgets/community_drawer.dart index 1946aa005..a7bb2c60c 100644 --- a/lib/community/widgets/community_drawer.dart +++ b/lib/community/widgets/community_drawer.dart @@ -144,7 +144,21 @@ class _CommunityDrawerState extends State { Navigator.of(context).pop(); }, - child: Text(context.read().state.subsciptions[index].community.name), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + context.read().state.subsciptions[index].community.title, + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + Text( + context.read().state.subsciptions[index].community.name, + style: theme.textTheme.bodyMedium, + ) + ], + ), ); }), ),