fix: mcp sort list

This commit is contained in:
Faisal Amir 2025-08-27 18:25:13 +07:00
parent 742f9c1a70
commit d922d7454d

View File

@ -52,7 +52,10 @@ export const useMCPServers = create<MCPServerStoreState>()((set, get) => ({
// Add a new MCP server or update if the key already exists
addServer: (key, config) =>
set((state) => {
const mcpServers = { [key]: config, ...state.mcpServers }
// Remove the key first if it exists to maintain insertion order
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { [key]: _, ...restServers } = state.mcpServers
const mcpServers = { [key]: config, ...restServers }
return { mcpServers }
}),