feat: Add lightweight Disconnect button
This commit is contained in:
parent
fa7f9c80cd
commit
9ab213bc89
1 changed files with 31 additions and 11 deletions
|
|
@ -321,6 +321,14 @@ export function useConnection({
|
|||
}
|
||||
};
|
||||
|
||||
const disconnect = async () => {
|
||||
await mcpClient?.close();
|
||||
setMcpClient(null);
|
||||
setConnectionStatus("disconnected");
|
||||
setCompletionsSupported(false);
|
||||
setServerCapabilities(null);
|
||||
};
|
||||
|
||||
return {
|
||||
connectionStatus,
|
||||
serverCapabilities,
|
||||
|
|
@ -331,5 +339,6 @@ export function useConnection({
|
|||
handleCompletion,
|
||||
completionsSupported,
|
||||
connect,
|
||||
disconnect,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue