From ec1a8567a4a59439779d8c511d2188894d85a15e Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 3 Jul 2025 20:53:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20Redirect=20to=20New=20Cha?= =?UTF-8?q?t=20if=20No=20Marketplace=20Access=20and=20Required=20Agent=20N?= =?UTF-8?q?ame=20Placeholder=20(#8213)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: Fix the redirect to new chat page if access to marketplace is denied * Fixed the required agent name placeholder --------- Co-authored-by: Atef Bellaaj --- .../SidePanel/Agents/AgentMarketplace.tsx | 13 ++++++++++++- client/src/locales/en/translation.json | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/client/src/components/SidePanel/Agents/AgentMarketplace.tsx b/client/src/components/SidePanel/Agents/AgentMarketplace.tsx index 3557a01197..1731708681 100644 --- a/client/src/components/SidePanel/Agents/AgentMarketplace.tsx +++ b/client/src/components/SidePanel/Agents/AgentMarketplace.tsx @@ -173,8 +173,19 @@ const AgentMarketplace: React.FC = ({ className = '' }) = permissionType: PermissionTypes.MARKETPLACE, permission: Permissions.USE, }); + useEffect(() => { + let timeoutId: ReturnType; + if (!hasAccessToMarketplace) { + timeoutId = setTimeout(() => { + navigate('/c/new'); + }, 1000); + } + return () => { + clearTimeout(timeoutId); + }; + }, [hasAccessToMarketplace, navigate]); + if (!hasAccessToMarketplace) { - navigate('/not-found', { replace: true }); return null; } return ( diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json index 6de9121fa6..cb8bb95f5a 100644 --- a/client/src/locales/en/translation.json +++ b/client/src/locales/en/translation.json @@ -23,7 +23,7 @@ "com_agents_mcp_trust_subtext": "Custom connectors are not verified by LibreChat", "com_agents_mcps_disabled": "You need to create an agent before adding MCPs.", "com_agents_missing_provider_model": "Please select a provider and model before creating an agent.", - "com_agents_name_placeholder": "Optional: The name of the agent", + "com_agents_name_placeholder": "The name of the agent", "com_agents_no_access": "You don't have access to edit this agent.", "com_agents_no_agent_id_error": "No agent ID found. Please ensure the agent is created first.", "com_agents_not_available": "Agent Not Available", @@ -1204,4 +1204,4 @@ "com_agents_marketplace_subtitle": "Discover and use powerful AI agents to enhance your workflows and productivity", "com_ui_agent_name_is_required": "Agent name is required", "com_agents_missing_name": "Please type in a name before creating an agent." -} \ No newline at end of file +}