diff --git a/lib/src/presentation/pages/suggestions/suggestions_state.dart b/lib/src/presentation/pages/suggestions/suggestions_state.dart index 5905103..8e5545d 100644 --- a/lib/src/presentation/pages/suggestions/suggestions_state.dart +++ b/lib/src/presentation/pages/suggestions/suggestions_state.dart @@ -138,15 +138,15 @@ extension SortTypeExtension on SortType { SortType.creationDate => (a, b) => b.creationTime.compareTo(a.creationTime), SortType.userSuggestion => (a, b) { - if (a.authorId == i.userId && b.authorId == i.userId) { - return b.upvotesCount.compareTo(a.upvotesCount); - } else if (a.authorId == i.userId) { + if (a.authorId == i.userId) { + if (b.authorId == i.userId) { + return b.upvotesCount.compareTo(a.upvotesCount); + } return -1; } else if (b.authorId == i.userId) { return 1; - } else { - return b.upvotesCount.compareTo(a.upvotesCount); } + return b.upvotesCount.compareTo(a.upvotesCount); } }; }