🔧 fix: Redirect to New Chat if No Marketplace Access and Required Agent Name Placeholder (#8213)

* 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 <slalom.bellaaj@external.daimlertruck.com>
This commit is contained in:
Peter 2025-07-03 20:53:49 +02:00 committed by Danny Avila
parent bbafa8e306
commit ec1a8567a4
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
2 changed files with 14 additions and 3 deletions

View file

@ -173,8 +173,19 @@ const AgentMarketplace: React.FC<AgentMarketplaceProps> = ({ className = '' }) =
permissionType: PermissionTypes.MARKETPLACE,
permission: Permissions.USE,
});
useEffect(() => {
let timeoutId: ReturnType<typeof setTimeout>;
if (!hasAccessToMarketplace) {
timeoutId = setTimeout(() => {
navigate('/c/new');
}, 1000);
}
return () => {
clearTimeout(timeoutId);
};
}, [hasAccessToMarketplace, navigate]);
if (!hasAccessToMarketplace) {
navigate('/not-found', { replace: true });
return null;
}
return (

View file

@ -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."
}
}