From 0f57e17742cd9ac24d8db1bd9836c8c9e813001a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rge=20N=C3=A6ss?= Date: Thu, 25 Jul 2024 12:12:45 +0200 Subject: [PATCH] fixup! feat(preview): add `unstable_observeDocument(s)` to preview store (#7176) --- packages/sanity/src/core/preview/documentPreviewStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sanity/src/core/preview/documentPreviewStore.ts b/packages/sanity/src/core/preview/documentPreviewStore.ts index 82bff355ad9..8246ffb9f7d 100644 --- a/packages/sanity/src/core/preview/documentPreviewStore.ts +++ b/packages/sanity/src/core/preview/documentPreviewStore.ts @@ -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})