Skip to content

Commit a08a82f

Browse files
authoredMar 20, 2024
fix(tasks): update how addonDatasetProvider ready state is set (#6076)
1 parent 6635d72 commit a08a82f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎packages/sanity/src/core/studio/addonDataset/AddonDatasetProvider.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,15 @@ export function AddonDatasetProvider(props: AddonDatasetSetupProviderProps) {
111111
// a client for it and set it in the context value so that the consumers can use
112112
// it to execute comment operations and set up the real time listener for the addon
113113
// dataset.
114-
getAddonDatasetName().then((addonDatasetName) => {
115-
if (!addonDatasetName) return
116-
const client = handleCreateClient(addonDatasetName)
117-
setAddonDatasetClient(client)
118-
setReady(true)
119-
})
114+
getAddonDatasetName()
115+
.then((addonDatasetName) => {
116+
if (!addonDatasetName) return
117+
const client = handleCreateClient(addonDatasetName)
118+
setAddonDatasetClient(client)
119+
})
120+
.finally(() => {
121+
setReady(true)
122+
})
120123
}, [getAddonDatasetName, handleCreateClient])
121124

122125
const ctxValue = useMemo(

0 commit comments

Comments
 (0)
Please sign in to comment.