mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(agent-list): close sidebar immediately on agent tap
Move onAgentSelect callback before navigation so the sidebar closes instantly instead of waiting for the navigation to complete. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,7 @@ export function AgentList({ agents, isRefreshing = false, onRefresh, selectedAge
|
||||
});
|
||||
const shouldReplace = pathname.startsWith("/agent/");
|
||||
const navigate = shouldReplace ? router.replace : router.push;
|
||||
onAgentSelect?.();
|
||||
navigate({
|
||||
pathname: "/agent/[serverId]/[agentId]",
|
||||
params: {
|
||||
@@ -66,7 +67,6 @@ export function AgentList({ agents, isRefreshing = false, onRefresh, selectedAge
|
||||
agentId,
|
||||
},
|
||||
});
|
||||
onAgentSelect?.();
|
||||
},
|
||||
[isActionSheetVisible, pathname, onAgentSelect]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user