From 43c8e8acf67970337cf42fdd9a829a791a3d89dc Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 18 Aug 2025 18:52:34 -0700 Subject: [PATCH] fix lint errs --- src/ui/ConfigSelector.tsx | 1 - src/ui/hooks/useConfigSelector.ts | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ui/ConfigSelector.tsx b/src/ui/ConfigSelector.tsx index 80a001232..652671c53 100644 --- a/src/ui/ConfigSelector.tsx +++ b/src/ui/ConfigSelector.tsx @@ -119,7 +119,6 @@ const ConfigSelector: React.FC = ({ const assistantSlug = getAssistantSlug(authConfig); if (assistantSlug) { // Find the matching config by slug and organization - const packageSlug = assistantSlug.split("/")[1]; const matchingConfig = options.find( (opt) => opt.type === "assistant" && diff --git a/src/ui/hooks/useConfigSelector.ts b/src/ui/hooks/useConfigSelector.ts index 0ce05ab26..4d57695ca 100644 --- a/src/ui/hooks/useConfigSelector.ts +++ b/src/ui/hooks/useConfigSelector.ts @@ -94,7 +94,10 @@ export function useConfigSelector({ // If we need to switch organizations, we'll handle both org + config switching // using a different approach to avoid duplicate reloads - if (config.organizationId !== currentOrgId) { + if (config.organizationId === currentOrgId) { + // Only config path is changing, no organization switch needed + await services.config.updateConfigPath(targetConfigPath); + } else { onMessage({ role: "system", content: `Switching to organization for ${config.name}...`, @@ -107,9 +110,6 @@ export function useConfigSelector({ // Update config path THEN reload services once // This avoids the double reload issue await services.config.updateConfigPath(targetConfigPath); - } else { - // Only config path is changing, no organization switch needed - await services.config.updateConfigPath(targetConfigPath); } // Reset chat history