From 48acbbfcb2aa5426004bad94ea1b42c243fde025 Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Fri, 2 Aug 2024 16:24:52 +0200 Subject: [PATCH] refactor: remove `prefersLatestPublished` handling --- .../panes/document/DocumentPaneProvider.tsx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx b/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx index a3ed706607e..56dd54bdc92 100644 --- a/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx +++ b/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx @@ -150,21 +150,6 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => { const [timelineError, setTimelineError] = useState(null) - /** - * The `preferLatestPublished` parameter can be used to "force" viewing the revision - * of the last published document. This is not a permanent function, and will likely - * be removed when we move to a more robust way of viewing "releases". - */ - useEffect(() => { - if (params.prefersLatestPublished && editState.published) { - setPaneParams({ - //ensure we only run on first load - ...omit(params, 'prefersLatestPublished'), - rev: `${editState.published._updatedAt}/${editState.published._rev}`, - }) - } - }, [editState, setPaneParams, params]) - /** * Create an intermediate store which handles document Timeline + TimelineController * creation, and also fetches pre-requsite document snapshots. Compatible with `useSyncExternalStore`