Skip to content

Commit afbf03e

Browse files
authored
Merge pull request #1107 from thunderstore-io/fix-upload-page-sorting
Fix upload page sorting [TS-2344] [TS-2345]
2 parents f24c7f1 + 4d29f51 commit afbf03e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

builder/src/upload.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,12 @@ const SubmissionForm: React.FC<SubmissionFormProps> = observer((props) => {
269269

270270
promise.then((result) => {
271271
const next = current.concat(result.results);
272-
next.sort((a, b) =>
273-
a.identifier == props.currentCommunity.identifier
274-
? -1
275-
: a.name.localeCompare(b.name)
276-
);
272+
next.sort((a, b) => {
273+
if (a.identifier == props.currentCommunity.identifier)
274+
return -1;
275+
if (b.identifier == props.currentCommunity.identifier) return 1;
276+
return a.name.localeCompare(b.name);
277+
});
277278
setCommunities(next);
278279
if (result.pagination.next_link) {
279280
enumerateCommunities(next, result.pagination.next_link);

django/thunderstore/social/api/experimental/views/current_user.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def get_teams(user: UserType) -> List[UserTeam]:
202202
)
203203
.exclude(team__is_active=False)
204204
.exclude(~Q(user=user))
205+
.order_by("id")
205206
)
206207

207208
return [

0 commit comments

Comments
 (0)