Skip to content

Commit

Permalink
Fix issues with search page reloading unnecessarily (#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Jan 5, 2024
1 parent 858c531 commit e5b62f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/search/pages/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class _SearchPageState extends State<SearchPage> with AutomaticKeepAliveClientMi
// When account changes, that means our instance most likely changed, so reset search.
if (state.status == AccountStatus.success &&
((activeProfile?.userId == null && _previousUserId != null) || state.personView?.person.id == activeProfile?.userId && _previousUserId != state.personView?.person.id) ||
state.favorites.length != _previousFavoritesCount) {
(state.favorites.length != _previousFavoritesCount && _controller.text.isEmpty)) {
_controller.clear();
if (context.mounted) context.read<SearchBloc>().add(ResetSearch());
setState(() {});
Expand Down Expand Up @@ -742,7 +742,9 @@ class _SearchPageState extends State<SearchPage> with AutomaticKeepAliveClientMi
),
const SizedBox(width: 4),
const Icon(Icons.people_rounded, size: 16.0),
if (indicateFavorites && _getFavoriteStatus(context, communityView.community)) ...const [
if (indicateFavorites &&
_getFavoriteStatus(context, communityView.community) &&
_getCurrentSubscriptionStatus(isUserLoggedIn, communityView, currentSubscriptions) == SubscribedType.subscribed) ...const [
Text(' · '),
Icon(Icons.star_rounded, size: 15),
]
Expand Down

0 comments on commit e5b62f4

Please sign in to comment.