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

Commit64631e1

Browse files
committed
Two is now one
1 parentddd2ea5 commit64631e1

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const canEditOrganization = (
2828
permissions:AuthorizationResponse|undefined,
2929
)=>{
3030
return(
31-
permissions&&
31+
permissions!==undefined&&
3232
(permissions.editOrganization||
3333
permissions.editMembers||
3434
permissions.editGroups)

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,10 @@ export const Sidebar: FC = () => {
3838
permissions:orgPermissionsQuery.data?.[org.id],
3939
};
4040
})
41-
// TypeScript is not able to infer whether permissions are defined from the
42-
// canEditOrganization call, so although redundant this helps figure it out.
43-
.filter(
44-
(org):org isOrganizationWithPermissions=>
45-
org.permissions!==undefined,
46-
)
47-
.filter((org)=>{
41+
// TypeScript is not able to infer whether permissions are defined on the
42+
// object even if we explicitly check org.permissions here, so add the `is`
43+
// here to help out (canEditOrganization does the actual check).
44+
.filter((org):org isOrganizationWithPermissions=>{
4845
returncanEditOrganization(org.permissions);
4946
});
5047

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp