mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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:
parent
584fe8d6f8
commit
e15ad23c46
7 changed files with 70 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue