diff --git a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx index 9d684a1d5a5..570745b4f55 100644 --- a/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx +++ b/packages/sanity/src/structure/components/requestPermissionDialog/RequestPermissionDialog.tsx @@ -39,7 +39,7 @@ export const LoadingContainer = styled(Flex).attrs({ /** @internal */ export interface RequestPermissionDialogProps { onClose?: () => void - onRequstSubmitted?: () => void + onRequestSubmitted?: () => void } /** @@ -51,7 +51,7 @@ export interface RequestPermissionDialogProps { */ export function RequestPermissionDialog({ onClose, - onRequstSubmitted, + onRequestSubmitted, }: RequestPermissionDialogProps) { const {t} = useTranslation(structureLocaleNamespace) const dialogId = `request-permissions-${useId()}` @@ -98,7 +98,7 @@ export function RequestPermissionDialog({ }) .then((request) => { if (request) { - if (onRequstSubmitted) onRequstSubmitted() + if (onRequestSubmitted) onRequestSubmitted() toast.push({title: 'Edit access requested'}) } }) diff --git a/packages/sanity/src/structure/panes/document/documentPanel/banners/PermissionCheckBanner.tsx b/packages/sanity/src/structure/panes/document/documentPanel/banners/PermissionCheckBanner.tsx index 2126ea788ba..eaddfdcad1b 100644 --- a/packages/sanity/src/structure/panes/document/documentPanel/banners/PermissionCheckBanner.tsx +++ b/packages/sanity/src/structure/panes/document/documentPanel/banners/PermissionCheckBanner.tsx @@ -58,7 +58,10 @@ export function PermissionCheckBanner({granted, requiredPermission}: PermissionC icon={ReadOnlyIcon} /> {showRequestPermissionDialog && ( - setShowDialog(false)} /> + setShowDialog(false)} + onRequestSubmitted={() => setShowDialog(false)} + /> )} )