diff --git a/packages/sanity/src/core/bundles/hooks/usePerspective.tsx b/packages/sanity/src/core/bundles/hooks/usePerspective.tsx index a32b0ae2772..b9618b1ada5 100644 --- a/packages/sanity/src/core/bundles/hooks/usePerspective.tsx +++ b/packages/sanity/src/core/bundles/hooks/usePerspective.tsx @@ -35,9 +35,7 @@ export function usePerspective(selectedPerspective?: string): PerspectiveValue { const selectedBundle = perspective && bundles - ? bundles.find((bundle: BundleDocument) => { - return `bundle.${bundle._id}`.toLocaleLowerCase() === perspective?.toLocaleLowerCase() - }) + ? bundles.find((bundle: BundleDocument) => `bundle.${bundle._id}` === perspective) : LATEST // TODO: Improve naming; this may not be global. diff --git a/packages/sanity/src/core/store/bundles/types.ts b/packages/sanity/src/core/store/bundles/types.ts index fed22471429..519a4c3073d 100644 --- a/packages/sanity/src/core/store/bundles/types.ts +++ b/packages/sanity/src/core/store/bundles/types.ts @@ -33,7 +33,7 @@ export type FormBundleDocument = PartialExcept * @internal */ export function isBundleDocument(doc: unknown): doc is BundleDocument { - return typeof doc === 'object' && doc !== null && '_type' in doc && doc._type === 'bundle' + return typeof doc === 'object' && doc !== null && '_type' in doc && doc._type === 'release' } /**