Skip to content

Commit

Permalink
fixup! feat(preview): add unstable_observeDocument(s) to preview st…
Browse files Browse the repository at this point in the history
…ore (#7176)
  • Loading branch information
bjoerge committed Aug 2, 2024
1 parent 66ab3a1 commit 7a6599d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sanity/src/core/preview/documentPreviewStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function createDocumentPreviewStore({
function getObserveFields() {
if (PREVIEW_FETCH_FULL_DOCUMENTS) {
return function observeFields(id: string, fields: string[], apiConfig?: ApiConfig) {
return observeDocument(id, apiConfig).pipe(map((doc) => pick(doc, fields)))
return observeDocument(id, apiConfig).pipe(map((doc) => (doc ? pick(doc, fields) : null)))
}
}
return createObserveFields({client: versionedClient, invalidationChannel})
Expand Down

0 comments on commit 7a6599d

Please sign in to comment.