🪵 chore: Remove Unnecessary Comments

This commit is contained in:
Danny Avila 2025-07-29 14:59:58 -04:00
parent 6fd3b569ac
commit 32081245da
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
3 changed files with 8 additions and 37 deletions

View file

@ -35,8 +35,10 @@ function MCPSelect() {
const statusIconProps = getServerStatusIconProps(serverName);
const isServerInitializing = isInitializing(serverName);
// Common wrapper for the main content (check mark + text)
// Ensures Check & Text are adjacent and the group takes available space.
/**
Common wrapper for the main content (check mark + text).
Ensures Check & Text are adjacent and the group takes available space.
*/
const mainContentWrapper = (
<button
type="button"
@ -66,12 +68,10 @@ function MCPSelect() {
[getServerStatusIconProps, isInitializing],
);
// Don't render if no servers are selected and not pinned
if ((!mcpValues || mcpValues.length === 0) && !isPinned) {
return null;
}
// Don't render if no MCP servers are configured
if (!configuredServers || configuredServers.length === 0) {
return null;
}

View file

@ -3,15 +3,15 @@ import { useToastContext } from '@librechat/client';
import { useQueryClient } from '@tanstack/react-query';
import { Constants, QueryKeys } from 'librechat-data-provider';
import {
useCancelMCPOAuthMutation,
useUpdateUserPluginsMutation,
useReinitializeMCPServerMutation,
useCancelMCPOAuthMutation,
} from 'librechat-data-provider/react-query';
import { useMCPConnectionStatusQuery } from '~/data-provider/Tools/queries';
import type { TUpdateUserPlugins, TPlugin } from 'librechat-data-provider';
import type { ConfigFieldDetail } from '~/components/MCP/MCPConfigDialog';
import { useLocalize } from '~/hooks';
import { useMCPConnectionStatusQuery } from '~/data-provider/Tools/queries';
import { useBadgeRowContext } from '~/Providers';
import { useLocalize } from '~/hooks';
interface ServerState {
isInitializing: boolean;
@ -273,10 +273,8 @@ export function useMCPServerManager() {
const cancelOAuthFlow = useCallback(
(serverName: string) => {
// Call backend cancellation first, then clean up frontend state on success
cancelOAuthMutation.mutate(serverName, {
onSuccess: () => {
// Only clean up frontend state after backend confirms cancellation
cleanupServerState(serverName);
queryClient.invalidateQueries([QueryKeys.mcpConnectionStatus]);