|
@@ -221,23 +221,22 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
|
|
sdk.client.app.agents().then((x) => setStore("agent", x.data ?? [])),
|
|
sdk.client.app.agents().then((x) => setStore("agent", x.data ?? [])),
|
|
|
sdk.client.config.get().then((x) => setStore("config", x.data!)),
|
|
sdk.client.config.get().then((x) => setStore("config", x.data!)),
|
|
|
]).then(() => {
|
|
]).then(() => {
|
|
|
- if (store.status === "loading") setStore("status", "partial")
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- // non-blocking
|
|
|
|
|
- Promise.all([
|
|
|
|
|
- sdk.client.session.list().then((x) =>
|
|
|
|
|
- setStore(
|
|
|
|
|
- "session",
|
|
|
|
|
- (x.data ?? []).toSorted((a, b) => a.id.localeCompare(b.id)),
|
|
|
|
|
|
|
+ setStore("status", "partial")
|
|
|
|
|
+ // non-blocking
|
|
|
|
|
+ Promise.all([
|
|
|
|
|
+ sdk.client.session.list().then((x) =>
|
|
|
|
|
+ setStore(
|
|
|
|
|
+ "session",
|
|
|
|
|
+ (x.data ?? []).toSorted((a, b) => a.id.localeCompare(b.id)),
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
- ),
|
|
|
|
|
- sdk.client.command.list().then((x) => setStore("command", x.data ?? [])),
|
|
|
|
|
- sdk.client.lsp.status().then((x) => setStore("lsp", x.data!)),
|
|
|
|
|
- sdk.client.mcp.status().then((x) => setStore("mcp", x.data!)),
|
|
|
|
|
- sdk.client.formatter.status().then((x) => setStore("formatter", x.data!)),
|
|
|
|
|
- ]).then(() => {
|
|
|
|
|
- setStore("status", "complete")
|
|
|
|
|
|
|
+ sdk.client.command.list().then((x) => setStore("command", x.data ?? [])),
|
|
|
|
|
+ sdk.client.lsp.status().then((x) => setStore("lsp", x.data!)),
|
|
|
|
|
+ sdk.client.mcp.status().then((x) => setStore("mcp", x.data!)),
|
|
|
|
|
+ sdk.client.formatter.status().then((x) => setStore("formatter", x.data!)),
|
|
|
|
|
+ ]).then(() => {
|
|
|
|
|
+ setStore("status", "complete")
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const result = {
|
|
const result = {
|