Skip to content

Commit b5c5503

Browse files
committed
fix: call useRuntimeConfig within useSanity
resolves nuxt-modules#1077
1 parent 1ed1386 commit b5c5503

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/runtime/server/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { SanityHelper } from '#sanity-composables'
77
import { useRuntimeConfig } from '#imports'
88

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

1211
const createSanityHelper = (options: ClientConfig): SanityHelper => {
1312
const config = { ...options }
@@ -25,6 +24,7 @@ const createSanityHelper = (options: ClientConfig): SanityHelper => {
2524
}
2625

2726
export const useSanity = (client = 'default'): SanityHelper => {
27+
const $config = useRuntimeConfig()
2828
if (client in clients) {
2929
return clients[client]
3030
}

0 commit comments

Comments
 (0)