Skip to content

Commit 9665e78

Browse files
committed
Appease Ellipsis
1 parent ca35de3 commit 9665e78

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

webview-ui/src/components/mcp/McpEnabledToggle.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
2+
import { FormEvent } from "react"
23
import { useExtensionState } from "../../context/ExtensionStateContext"
34
import { vscode } from "../../utils/vscode"
45

56
const McpEnabledToggle = () => {
67
const { mcpEnabled, setMcpEnabled } = useExtensionState()
78

9+
const handleChange = (e: Event | FormEvent<HTMLElement>) => {
10+
const target = ('target' in e ? e.target : null) as HTMLInputElement | null
11+
if (!target) return
12+
setMcpEnabled(target.checked)
13+
vscode.postMessage({ type: "mcpEnabled", bool: target.checked })
14+
}
15+
816
return (
917
<div style={{ marginBottom: "20px" }}>
1018
<VSCodeCheckbox
1119
checked={mcpEnabled}
12-
onChange={(e: any) => {
13-
setMcpEnabled(e.target.checked)
14-
vscode.postMessage({ type: "mcpEnabled", bool: e.target.checked })
15-
}}>
20+
onChange={handleChange}>
1621
<span style={{ fontWeight: "500" }}>Enable MCP Servers</span>
1722
</VSCodeCheckbox>
1823
<p style={{

0 commit comments

Comments
 (0)