Skip to content

Commit

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

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

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

0 comments on commit f411c4e

Please sign in to comment.