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

@ -403,6 +403,18 @@ class UIViewModel @Inject constructor(
initialValue = emptyList(),
)
val onlineNodeCount = nodeDB.onlineNodeCount.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5_000),
initialValue = 0,
)
val totalNodeCount = nodeDB.totalNodeCount.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5_000),
initialValue = 0,
)
val filteredNodeList: StateFlow<List<Node>> = nodeList.mapLatest { list ->
list.filter { node ->
!node.isIgnored