Skip to content

Commit

Permalink
fixup! fix(core): remove bundle slugs in favor of bundle id (#7427)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge authored and juice49 committed Oct 7, 2024
1 parent c9dc8f0 commit 7d070e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/sanity/src/core/bundles/hooks/usePerspective.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/store/bundles/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type FormBundleDocument = PartialExcept<BundleDocument, '_id' | '_type'>
* @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'
}

/**
Expand Down

0 comments on commit 7d070e3

Please sign in to comment.