From cfd4cba77e66d041b68c69f8526992299a8c7b65 Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Tue, 12 Nov 2024 00:15:47 +0100 Subject: [PATCH] fix: support deprecated `draftMode` preview URL config --- packages/presentation/src/PresentationTool.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/presentation/src/PresentationTool.tsx b/packages/presentation/src/PresentationTool.tsx index bd0ed3a6f..280bdc7df 100644 --- a/packages/presentation/src/PresentationTool.tsx +++ b/packages/presentation/src/PresentationTool.tsx @@ -108,6 +108,16 @@ export default function PresentationTool(props: { canCreateUrlPreviewSecrets, ) const canSharePreviewAccess = useMemo(() => { + if ( + _previewUrl && + typeof _previewUrl === 'object' && + 'draftMode' in _previewUrl && + _previewUrl.draftMode + ) { + // eslint-disable-next-line no-console + console.warn('previewUrl.draftMode is deprecated, use previewUrl.previewMode instead') + return _previewUrl.draftMode.shareAccess !== false + } if ( _previewUrl && typeof _previewUrl === 'object' &&