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
parent 985663620f
commit c6ebc7ff7c
5 changed files with 33 additions and 15 deletions

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(