mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
fix(app): start MCP sign-in from row click (#51001)
This commit is contained in:
parent
6e0857cc0e
commit
8d5eb3bf9c
1 changed files with 10 additions and 0 deletions
|
|
@ -243,6 +243,16 @@ function McpMenu(props: ServiceMenuProps) {
|
|||
aria-busy={props.mcp?.pending ?? toggle.isPending}
|
||||
onChange={change}
|
||||
onClick={(event: MouseEvent) => {
|
||||
if (
|
||||
!(event.target instanceof Element) ||
|
||||
event.target.closest('[data-slot="switch-control"], [data-slot="switch-input"]')
|
||||
)
|
||||
return
|
||||
// Outside the switch itself, a row that requires sign-in starts sign-in instead of toggling.
|
||||
if (!preview() && server().status.status === "needs_auth") {
|
||||
event.preventDefault()
|
||||
return change(true)
|
||||
}
|
||||
if (event.target === event.currentTarget) change(!enabled())
|
||||
}}
|
||||
title={preview() ? server().name : (error() ?? server().name)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue