Skip to content

Commit

Permalink
fix(core): update how bundleSlug is obtained from the version ids (#7426
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pedrobonamin authored Aug 28, 2024
1 parent 4b54e7a commit ff76dea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {type SanityDocument, type Schema} from '@sanity/types'
import {combineLatest, type Observable} from 'rxjs'
import {map, publishReplay, refCount, startWith, switchMap} from 'rxjs/operators'

import {getVersionFromId} from '../../../../util'
import {type IdPair, type PendingMutationsEvent} from '../types'
import {memoize} from '../utils/createMemoizer'
import {memoizeKeyGen} from './memoizeKeyGen'
Expand Down Expand Up @@ -79,7 +80,7 @@ export const editState = memoize(
liveEditSchemaType,
ready: true,
transactionSyncLock,
bundleSlug: idPair.versionId?.split('.').at(0),
bundleSlug: idPair.versionId ? getVersionFromId(idPair.versionId) : undefined,
})),
startWith({
id: idPair.publishedId,
Expand All @@ -91,7 +92,7 @@ export const editState = memoize(
liveEditSchemaType,
ready: false,
transactionSyncLock: null,
bundleSlug: idPair.versionId?.split('.').at(0),
bundleSlug: idPair.versionId ? getVersionFromId(idPair.versionId) : undefined,
}),
publishReplay(1),
refCount(),
Expand Down

0 comments on commit ff76dea

Please sign in to comment.