fix(tui): refresh MCP data for default location
This commit is contained in:
parent
9b8282ad3d
commit
e0a4fecd5b
1 changed files with 2 additions and 2 deletions
|
|
@ -1044,7 +1044,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
|
||||||
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.server
|
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.server
|
||||||
},
|
},
|
||||||
async refresh(ref?: LocationRef) {
|
async refresh(ref?: LocationRef) {
|
||||||
const result = await client.api.mcp.list({ location: locationQuery(ref) })
|
const result = await client.api.mcp.list({ location: locationQuery(ref ?? defaultLocation()) })
|
||||||
const key = locationKey(result.location)
|
const key = locationKey(result.location)
|
||||||
setStore("location", key, {
|
setStore("location", key, {
|
||||||
...store.location[key],
|
...store.location[key],
|
||||||
|
|
@ -1057,7 +1057,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
|
||||||
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.resource
|
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.resource
|
||||||
},
|
},
|
||||||
async refresh(ref?: LocationRef) {
|
async refresh(ref?: LocationRef) {
|
||||||
const result = await client.api.mcp.resource.catalog({ location: locationQuery(ref) })
|
const result = await client.api.mcp.resource.catalog({ location: locationQuery(ref ?? defaultLocation()) })
|
||||||
const key = locationKey(result.location)
|
const key = locationKey(result.location)
|
||||||
setStore("location", key, {
|
setStore("location", key, {
|
||||||
...store.location[key],
|
...store.location[key],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue