We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e76ebc commit bfa0000Copy full SHA for bfa0000
site/src/pages/ManagementSettingsPage/OrganizationSettingsPage.tsx
@@ -50,12 +50,9 @@ const OrganizationSettingsPage: FC = () => {
50
const editableOrg = organizations
51
.sort((a, b) => {
52
// Prefer default org (it may not be first).
53
- if (a.is_default) {
54
- return -1;
55
- } else if (b.is_default) {
56
- return 1;
57
- }
58
- return 0;
+ // JavaScript will happily subtract booleans, but use numbers to keep
+ // the compiler happy.
+ return (b.is_default ? 1 : 0) - (a.is_default ? 1 : 0);
59
})
60
.find((org) => canEditOrganization(permissions[org.id]));
61
if (editableOrg) {
0 commit comments