@@ -153,15 +153,14 @@ const AssistantSelectOption = ({
153
153
export default function AssistantSelect ( ) {
154
154
const dispatch = useAppDispatch ( ) ;
155
155
const buttonRef = useRef < HTMLButtonElement > ( null ) ;
156
- const { selectedProfile, refreshProfiles } = useAuth ( ) ;
157
156
const currentOrg = useAppSelector ( selectCurrentOrg ) ;
158
157
const orgs = useAppSelector ( ( store ) => store . profiles . organizations ) ;
159
158
const ideMessenger = useContext ( IdeMessengerContext ) ;
160
159
const { isToolbarExpanded } = useLump ( ) ;
161
160
const [ loading , setLoading ] = useState ( false ) ;
162
161
163
- const { profiles, session, login } = useAuth ( ) ;
164
- const navigate = useNavigate ( ) ;
162
+ const { profiles, session, login, selectedProfile , refreshProfiles } =
163
+ useAuth ( ) ;
165
164
166
165
function close ( ) {
167
166
if ( buttonRef . current ) {
@@ -218,6 +217,11 @@ export default function AssistantSelect() {
218
217
} , [ currentOrg , selectedProfile ] ) ;
219
218
220
219
const cycleOrgs = ( ) => {
220
+ if ( ! session ) {
221
+ void login ( false ) ;
222
+ return ;
223
+ }
224
+
221
225
const orgIds = orgs . map ( ( org ) => org . id ) ;
222
226
if ( orgIds . length < 2 ) {
223
227
return ;
@@ -358,7 +362,7 @@ export default function AssistantSelect() {
358
362
/>
359
363
360
364
< div
361
- className = "text-description flex items-center justify-between px-2 py-1"
365
+ className = "text-description flex items-center justify-between gap-1.5 px-2 py-1"
362
366
style = { {
363
367
fontSize : tinyFont ,
364
368
} }
0 commit comments