feat: Initial implementation of adding nodes to favorites (#1520)

* Implement initial support for adding and removing nodes from favorites

* Make favorite nodes' names show up bold in the node list

* Forgot to add this here when I was fixing the previous merge conflicts. Whoops!

* Make detekt happy

---------

Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
Ken Piper 2025-02-16 06:02:02 -06:00 committed by GitHub
parent 584fe8d6f8
commit e15ad23c46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 70 additions and 1 deletions

View file

@ -485,6 +485,14 @@ class UIViewModel @Inject constructor(
updateLoraConfig { it.copy { region = value } }
}
fun favoriteNode(node: Node) = viewModelScope.launch {
try {
radioConfigRepository.onServiceAction(ServiceAction.Favorite(node))
} catch (ex: RemoteException) {
errormsg("Favorite node error:", ex)
}
}
fun ignoreNode(node: Node) = viewModelScope.launch {
try {
radioConfigRepository.onServiceAction(ServiceAction.Ignore(node))