feat: show online and total node count in the title bar (#2209)

This commit is contained in:
James Rich 2025-06-22 02:10:36 +00:00 committed by GitHub
parent 450014a0f6
commit c4c115b901
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 1 deletions

View file

@ -376,10 +376,15 @@ private fun MainAppBar(
return
}
val title by viewModel.title.collectAsStateWithLifecycle("")
val onlineNodeCount by viewModel.onlineNodeCount.collectAsStateWithLifecycle(0)
val totalNodeCount by viewModel.totalNodeCount.collectAsStateWithLifecycle(0)
TopAppBar(
title = {
val title = when {
currentDestination == null || isTopLevelRoute -> stringResource(id = R.string.app_name)
currentDestination == null -> stringResource(id = R.string.app_name)
currentDestination.hasRoute<NodesRoutes.Nodes>() -> stringResource(id = R.string.app_name) +
" ($onlineNodeCount/$totalNodeCount)"
currentDestination.hasRoute<Route.DebugPanel>() -> stringResource(id = R.string.debug_panel)