Merge branch 'main' into oleina/logging
This commit is contained in:
commit
e573e855f0
1 changed files with 212 additions and 3 deletions
|
|
@ -466,10 +466,24 @@ const App = () => {
|
|||
}, [roots]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!window.location.hash) {
|
||||
window.location.hash = "resources";
|
||||
if (mcpClient && !window.location.hash) {
|
||||
const defaultTab = serverCapabilities?.resources
|
||||
? "resources"
|
||||
: serverCapabilities?.prompts
|
||||
? "prompts"
|
||||
: serverCapabilities?.tools
|
||||
? "tools"
|
||||
: "ping";
|
||||
window.location.hash = defaultTab;
|
||||
} else if (!mcpClient && window.location.hash) {
|
||||
// Clear hash when disconnected - completely remove the fragment
|
||||
window.history.replaceState(
|
||||
null,
|
||||
"",
|
||||
window.location.pathname + window.location.search,
|
||||
);
|
||||
}
|
||||
}, []);
|
||||
}, [mcpClient, serverCapabilities]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleHashChange = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue