Skip to content

Commit

Permalink
fix: allow usage of visual editing useSanityQuery without awaiting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 2, 2024
1 parent 92e4353 commit b75d2eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/composables/visual-editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export const useSanityQuery = <T = unknown, E = Error> (
onScopeDispose(unsubscribe)
}

return new Promise(resolve => {
return Object.assign(result, new Promise(resolve => {
result.then(value => {
updateRefs(value.data.value.data, value.data.value.sourceMap)
resolve({
Expand All @@ -297,7 +297,7 @@ export const useSanityQuery = <T = unknown, E = Error> (
encodeDataAttribute,
})
})
}) as AsyncSanityData<T | null, E>
})) as AsyncSanityData<T | null, E>
}

export function useSanityLiveMode (options?: { client?: string }) {
Expand Down

0 comments on commit b75d2eb

Please sign in to comment.