Skip to content

Commit

Permalink
ref sort by user suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
trullse committed Oct 2, 2024
1 parent 19fcb9a commit 57ed340
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/presentation/pages/suggestions/suggestions_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
}
Expand Down

0 comments on commit 57ed340

Please sign in to comment.