fix(tui): only show org switch affordances when useful (#21054)

This commit is contained in:
Kit Langton 2026-04-04 19:25:37 -04:00 • committed by GitHub
commit c6ebc7ff7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,11 @@ export const ExperimentalRoutes = lazy(() =>
},
}),
async (c) => {
return c.json(await Config.getConsoleState())
const [consoleState, groups] = await Promise.all([Config.getConsoleState(), Account.orgsByAccount()])
return c.json({
...consoleState,
switchableOrgCount: groups.reduce((count, group) => count + group.orgs.length, 0),
})
},
)
.get(