diff --git a/packages/sanity/src/core/store/_legacy/document/document-pair/editState.ts b/packages/sanity/src/core/store/_legacy/document/document-pair/editState.ts index ac8b37495947..14e5eaee1f33 100644 --- a/packages/sanity/src/core/store/_legacy/document/document-pair/editState.ts +++ b/packages/sanity/src/core/store/_legacy/document/document-pair/editState.ts @@ -1,6 +1,6 @@ import {type SanityClient} from '@sanity/client' import {type SanityDocument, type Schema} from '@sanity/types' -import {combineLatest, type Observable} from 'rxjs' +import {combineLatest, type Observable, of} from 'rxjs' import {map, publishReplay, refCount, startWith, switchMap} from 'rxjs/operators' import {getVersionFromId} from '../../../../util' @@ -80,7 +80,7 @@ export const editState = memoize( map((ev: PendingMutationsEvent) => (ev.phase === 'begin' ? LOCKED : NOT_LOCKED)), startWith(NOT_LOCKED), ), - ...(typeof versions.version === 'undefined' ? [] : [versions.version.snapshots$]), + typeof versions.version === 'undefined' ? of(undefined) : versions.version.snapshots$, ]), ), swr(`${idPair.publishedId}-${idPair.draftId}`),