Skip to content

Commit

Permalink
fix: call useRuntimeConfig within useSanity
Browse files Browse the repository at this point in the history
resolves #1077
  • Loading branch information
danielroe committed Nov 20, 2024
1 parent 1ed1386 commit b5c5503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/server/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type { SanityHelper } from '#sanity-composables'
import { useRuntimeConfig } from '#imports'

const clients: Record<string, SanityHelper> = {}
const $config = useRuntimeConfig()

const createSanityHelper = (options: ClientConfig): SanityHelper => {
const config = { ...options }
Expand All @@ -25,6 +24,7 @@ const createSanityHelper = (options: ClientConfig): SanityHelper => {
}

export const useSanity = (client = 'default'): SanityHelper => {
const $config = useRuntimeConfig()
if (client in clients) {
return clients[client]
}
Expand Down

0 comments on commit b5c5503

Please sign in to comment.