From 0e6c2b53d983bea8c5d27a127995e139fd008496 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 19 May 2025 20:17:26 -0700 Subject: [PATCH 1/2] if not signed in, cycle orgs triggers login --- .../modelSelection/platform/AssistantSelect.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index dae2136df..6e3c80c49 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -153,15 +153,14 @@ const AssistantSelectOption = ({ export default function AssistantSelect() { const dispatch = useAppDispatch(); const buttonRef = useRef(null); - const { selectedProfile, refreshProfiles } = useAuth(); const currentOrg = useAppSelector(selectCurrentOrg); const orgs = useAppSelector((store) => store.profiles.organizations); const ideMessenger = useContext(IdeMessengerContext); const { isToolbarExpanded } = useLump(); const [loading, setLoading] = useState(false); - const { profiles, session, login } = useAuth(); - const navigate = useNavigate(); + const { profiles, session, login, selectedProfile, refreshProfiles } = + useAuth(); function close() { if (buttonRef.current) { @@ -220,6 +219,9 @@ export default function AssistantSelect() { const cycleOrgs = () => { const orgIds = orgs.map((org) => org.id); if (orgIds.length < 2) { + if (!session) { + void login(false); + } return; } let nextId = orgIds[0]; @@ -358,7 +360,7 @@ export default function AssistantSelect() { />
Date: Mon, 19 May 2025 20:17:44 -0700 Subject: [PATCH 2/2] if not signed in, cycle orgs triggers login --- .../modelSelection/platform/AssistantSelect.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 6e3c80c49..4281221a5 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -217,11 +217,13 @@ export default function AssistantSelect() { }, [currentOrg, selectedProfile]); const cycleOrgs = () => { + if (!session) { + void login(false); + return; + } + const orgIds = orgs.map((org) => org.id); if (orgIds.length < 2) { - if (!session) { - void login(false); - } return; } let nextId = orgIds[0];