mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
feat: add startup flag check to conditional rendering logic
This commit is contained in:
parent
49f87016a8
commit
084de9a912
3 changed files with 6 additions and 2 deletions
|
|
@ -3,9 +3,9 @@ const { logger } = require('@librechat/data-schemas');
|
|||
const { CacheKeys, defaultSocialLogins, Constants } = require('librechat-data-provider');
|
||||
const { getCustomConfig } = require('~/server/services/Config/getCustomConfig');
|
||||
const { getLdapConfig } = require('~/server/services/Config/ldap');
|
||||
const { getMCPManager } = require('~/config');
|
||||
const { getProjectByName } = require('~/models/Project');
|
||||
const { isEnabled } = require('~/server/utils');
|
||||
const { getMCPManager } = require('~/config');
|
||||
const { getLogStores } = require('~/cache');
|
||||
|
||||
const router = express.Router();
|
||||
|
|
@ -105,12 +105,14 @@ router.get('/', async function (req, res) {
|
|||
if (config?.mcpServers != null) {
|
||||
const mcpManager = getMCPManager();
|
||||
const oauthServers = mcpManager.getOAuthServers();
|
||||
|
||||
for (const serverName in config.mcpServers) {
|
||||
const serverConfig = config.mcpServers[serverName];
|
||||
payload.mcpServers[serverName] = {
|
||||
customUserVars: serverConfig?.customUserVars || {},
|
||||
chatMenu: serverConfig?.chatMenu,
|
||||
isOAuth: oauthServers.has(serverName),
|
||||
startup: serverConfig?.startup,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,8 @@ export default function useSideNavLinks({
|
|||
Object.values(startupConfig.mcpServers).some(
|
||||
(server: any) =>
|
||||
(server.customUserVars && Object.keys(server.customUserVars).length > 0) ||
|
||||
server.isOAuth,
|
||||
server.isOAuth ||
|
||||
server.startup === false,
|
||||
)
|
||||
) {
|
||||
links.push({
|
||||
|
|
|
|||
|
|
@ -614,6 +614,7 @@ export type TStartupConfig = {
|
|||
>;
|
||||
chatMenu?: boolean;
|
||||
isOAuth?: boolean;
|
||||
startup?: boolean;
|
||||
}
|
||||
>;
|
||||
mcpPlaceholder?: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue