wip(desktop): progress
This commit is contained in:
parent
dbcc779f0b
commit
f736751ab2
4 changed files with 57 additions and 20 deletions
|
|
@ -13,7 +13,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
|||
const [store, setStore] = globalSync.child(sdk.directory)
|
||||
|
||||
const load = {
|
||||
project: () => sdk.client.project.current().then((x) => setStore("project", x.data!)),
|
||||
project: () => sdk.client.project.current().then((x) => setStore("project", x.data!.id)),
|
||||
provider: () => sdk.client.config.providers().then((x) => setStore("provider", x.data!.providers)),
|
||||
path: () => sdk.client.path.get().then((x) => setStore("path", x.data!)),
|
||||
agent: () => sdk.client.app.agents().then((x) => setStore("agent", x.data ?? [])),
|
||||
|
|
@ -41,6 +41,13 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
|||
get ready() {
|
||||
return store.ready
|
||||
},
|
||||
get project() {
|
||||
console.log("project", store.project)
|
||||
console.log("projects", globalSync.data.projects)
|
||||
const match = Binary.search(globalSync.data.projects, store.project, (p) => p.id)
|
||||
if (match.found) return globalSync.data.projects[match.index]
|
||||
return undefined
|
||||
},
|
||||
session: {
|
||||
get(sessionID: string) {
|
||||
const match = Binary.search(store.session, sessionID, (s) => s.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue