Skip to content

Commit 5ee38ad

Browse files
authoredMar 14, 2025··
fix(preview): don't apply preview fallback for documents in archived release (#8932)
1 parent 6ea3719 commit 5ee38ad

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed
 

‎packages/sanity/src/core/releases/tool/detail/useBundleDocuments.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ import {mergeMapArray} from 'rxjs-mergemap-array'
2727

2828
import {useSchema} from '../../../hooks'
2929
import {type LocaleSource} from '../../../i18n/types'
30-
import {
31-
type DocumentPreviewStore,
32-
getPreviewValueWithFallback,
33-
prepareForPreview,
34-
} from '../../../preview'
30+
import {type DocumentPreviewStore, prepareForPreview} from '../../../preview'
3531
import {useDocumentPreviewStore} from '../../../store/_legacy/datastores'
3632
import {useSource} from '../../../studio'
3733
import {getPublishedId} from '../../../util/draftUtils'
@@ -228,10 +224,7 @@ const getPublishedArchivedReleaseDocumentsObservable = ({
228224
take(1),
229225
map(({snapshot}) => ({
230226
isLoading: false,
231-
values: prepareForPreview(
232-
getPreviewValueWithFallback({snapshot, fallback: document}),
233-
schemaType,
234-
),
227+
values: prepareForPreview(snapshot || document, schemaType),
235228
})),
236229
startWith({isLoading: true, values: {}}),
237230
filter(({isLoading}) => !isLoading),

0 commit comments

Comments
 (0)
Please sign in to comment.