File tree 2 files changed +2
-12
lines changed
site/src/pages/ManagementSettingsPage
2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,10 @@ const OrganizationProvisionersPage: FC = () => {
14
14
const { organization : organizationName } = useParams ( ) as {
15
15
organization : string ;
16
16
} ;
17
- const { organizations } = useManagementSettings ( ) ;
17
+ const { organization } = useManagementSettings ( ) ;
18
18
const { entitlements } = useDashboard ( ) ;
19
19
const { metadata } = useEmbeddedMetadata ( ) ;
20
20
const buildInfoQuery = useQuery ( buildInfo ( metadata [ "build-info" ] ) ) ;
21
-
22
- const organization = organizations ?. find ( ( o ) => o . name === organizationName ) ;
23
21
const provisionersQuery = useQuery ( provisionerDaemonGroups ( organizationName ) ) ;
24
22
25
23
if ( ! organization ) {
Original file line number Diff line number Diff line change @@ -55,15 +55,7 @@ const OrganizationSettingsPage: FC = () => {
55
55
// .find will stop at the first match found; make sure default
56
56
// organizations are placed first
57
57
const editableOrg = [ ...organizations ]
58
- . sort ( ( a , b ) => {
59
- if ( a . is_default && ! b . is_default ) {
60
- return - 1 ;
61
- }
62
- if ( b . is_default && ! a . is_default ) {
63
- return 1 ;
64
- }
65
- return 0 ;
66
- } )
58
+ . sort ( ( a , b ) => ( b . is_default ? 1 : 0 ) - ( a . is_default ? 1 : 0 ) )
67
59
. find ( ( org ) => canEditOrganization ( permissions [ org . id ] ) ) ;
68
60
if ( editableOrg ) {
69
61
return < Navigate to = { `/organizations/${ editableOrg . name } ` } replace /> ;
You can’t perform that action at this time.
0 commit comments