MCPcopy
hub / github.com/claude-code-best/claude-code / onSubmit

Function onSubmit

src/components/MCPServerMultiselectDialog.tsx:17–47  ·  view source on GitHub ↗
(selectedServers: string[])

Source from the content-addressed store, hash-verified

15
16export function MCPServerMultiselectDialog({ serverNames, onDone }: Props): React.ReactNode {
17 function onSubmit(selectedServers: string[]) {
18 const currentSettings = getSettings_DEPRECATED() || {};
19 const enabledServers = currentSettings.enabledMcpjsonServers || [];
20 const disabledServers = currentSettings.disabledMcpjsonServers || [];
21
22 // Use partition to separate approved and rejected servers
23 const [approvedServers, rejectedServers] = partition(serverNames, server => selectedServers.includes(server));
24
25 logEvent('tengu_mcp_multidialog_choice', {
26 approved: approvedServers.length,
27 rejected: rejectedServers.length,
28 });
29
30 // Update settings with approved servers
31 if (approvedServers.length > 0) {
32 const newEnabledServers = [...new Set([...enabledServers, ...approvedServers])];
33 updateSettingsForSource('localSettings', {
34 enabledMcpjsonServers: newEnabledServers,
35 });
36 }
37
38 // Update settings with rejected servers
39 if (rejectedServers.length > 0) {
40 const newDisabledServers = [...new Set([...disabledServers, ...rejectedServers])];
41 updateSettingsForSource('localSettings', {
42 disabledMcpjsonServers: newDisabledServers,
43 });
44 }
45
46 onDone();
47 }
48
49 // Handle ESC to reject all servers
50 const handleEscRejectAll = useCallback(() => {

Callers 15

ChatInputFunction · 0.50
handleSubmitFunction · 0.50
handleSubmitFunction · 0.50
handleSubmitFunction · 0.50
handleSubmitFunction · 0.50
useMultiSelectStateFunction · 0.50
PromptInputFunction · 0.50
applyCommandSuggestionFunction · 0.50
ChooseRepoStepFunction · 0.50
ApiKeyStepFunction · 0.50
processInitialMessageFunction · 0.50

Calls 3

logEventFunction · 0.85
updateSettingsForSourceFunction · 0.85
onDoneFunction · 0.50

Tested by

no test coverage detected