Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbfa0000

Browse files
committed
Improved sort
1 parent9e76ebc commitbfa0000

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎site/src/pages/ManagementSettingsPage/OrganizationSettingsPage.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ const OrganizationSettingsPage: FC = () => {
5050
consteditableOrg=organizations
5151
.sort((a,b)=>{
5252
// Prefer default org (it may not be first).
53-
if(a.is_default){
54-
return-1;
55-
}elseif(b.is_default){
56-
return1;
57-
}
58-
return0;
53+
// JavaScript will happily subtract booleans, but use numbers to keep
54+
// the compiler happy.
55+
return(b.is_default ?1 :0)-(a.is_default ?1 :0);
5956
})
6057
.find((org)=>canEditOrganization(permissions[org.id]));
6158
if(editableOrg){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp