mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
🔧 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:
parent
bbafa8e306
commit
ec1a8567a4
2 changed files with 14 additions and 3 deletions
|
|
@ -173,8 +173,19 @@ const AgentMarketplace: React.FC<AgentMarketplaceProps> = ({ className = '' }) =
|
||||||
permissionType: PermissionTypes.MARKETPLACE,
|
permissionType: PermissionTypes.MARKETPLACE,
|
||||||
permission: Permissions.USE,
|
permission: Permissions.USE,
|
||||||
});
|
});
|
||||||
|
useEffect(() => {
|
||||||
|
let timeoutId: ReturnType<typeof setTimeout>;
|
||||||
|
if (!hasAccessToMarketplace) {
|
||||||
|
timeoutId = setTimeout(() => {
|
||||||
|
navigate('/c/new');
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
};
|
||||||
|
}, [hasAccessToMarketplace, navigate]);
|
||||||
|
|
||||||
if (!hasAccessToMarketplace) {
|
if (!hasAccessToMarketplace) {
|
||||||
navigate('/not-found', { replace: true });
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
"com_agents_mcp_trust_subtext": "Custom connectors are not verified by LibreChat",
|
"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_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_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_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_no_agent_id_error": "No agent ID found. Please ensure the agent is created first.",
|
||||||
"com_agents_not_available": "Agent Not Available",
|
"com_agents_not_available": "Agent Not Available",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue