fix race condition
This commit is contained in:
@@ -221,9 +221,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
sdk.client.app.agents().then((x) => setStore("agent", x.data ?? [])),
|
||||
sdk.client.config.get().then((x) => setStore("config", x.data!)),
|
||||
]).then(() => {
|
||||
if (store.status === "loading") setStore("status", "partial")
|
||||
})
|
||||
|
||||
setStore("status", "partial")
|
||||
// non-blocking
|
||||
Promise.all([
|
||||
sdk.client.session.list().then((x) =>
|
||||
@@ -239,6 +237,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
]).then(() => {
|
||||
setStore("status", "complete")
|
||||
})
|
||||
})
|
||||
|
||||
const result = {
|
||||
data: store,
|
||||
|
||||
Reference in New Issue
Block a user