fix(app): avoid disabled cursor during mcp toggle
This commit is contained in:
parent
4db321512f
commit
2a1565951f
2 changed files with 5 additions and 2 deletions
|
|
@ -321,7 +321,8 @@ export function StatusPopoverBody(props: { shown: Accessor<boolean> }) {
|
|||
name,
|
||||
status: mcpStatus(name),
|
||||
error: mcpError(name),
|
||||
pending: !mcpStatus(name) || (toggleMcp.isPending && toggleMcp.variables === name),
|
||||
loading: !mcpStatus(name),
|
||||
pending: toggleMcp.isPending && toggleMcp.variables === name,
|
||||
onToggle: () => {
|
||||
if (toggleMcp.isPending) return
|
||||
toggleMcp.mutate(name)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export type ToolsMenuProps = {
|
|||
name: string
|
||||
status?: ToolsMenuStatus
|
||||
error?: string
|
||||
loading?: boolean
|
||||
pending?: boolean
|
||||
onToggle?: () => void
|
||||
}>
|
||||
|
|
@ -101,9 +102,10 @@ export function ToolsMenu(props: ToolsMenuProps) {
|
|||
</Show>
|
||||
<Switch
|
||||
checked={item.status === "connected"}
|
||||
disabled={item.pending || !item.status}
|
||||
disabled={item.loading}
|
||||
hideLabel
|
||||
onChange={item.onToggle}
|
||||
readOnly={item.pending}
|
||||
>
|
||||
{item.name}
|
||||
</Switch>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue