Skip to content

Commit

Permalink
fix: update onRequestSubmitted handler
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Sep 26, 2024
1 parent e869f06 commit a2b4253
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const LoadingContainer = styled(Flex).attrs({
/** @internal */
export interface RequestPermissionDialogProps {
onClose?: () => void
onRequstSubmitted?: () => void
onRequestSubmitted?: () => void
}

/**
Expand All @@ -51,7 +51,7 @@ export interface RequestPermissionDialogProps {
*/
export function RequestPermissionDialog({
onClose,
onRequstSubmitted,
onRequestSubmitted,
}: RequestPermissionDialogProps) {
const {t} = useTranslation(structureLocaleNamespace)
const dialogId = `request-permissions-${useId()}`
Expand Down Expand Up @@ -98,7 +98,7 @@ export function RequestPermissionDialog({
})
.then((request) => {
if (request) {
if (onRequstSubmitted) onRequstSubmitted()
if (onRequestSubmitted) onRequestSubmitted()
toast.push({title: 'Edit access requested'})
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export function PermissionCheckBanner({granted, requiredPermission}: PermissionC
icon={ReadOnlyIcon}
/>
{showRequestPermissionDialog && (
<RequestPermissionDialog onClose={() => setShowDialog(false)} />
<RequestPermissionDialog
onClose={() => setShowDialog(false)}
onRequestSubmitted={() => setShowDialog(false)}
/>
)}
</>
)
Expand Down

0 comments on commit a2b4253

Please sign in to comment.