mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: unified getUser repository call for convention
This commit is contained in:
parent
e05c35afc2
commit
5cf9741b13
4 changed files with 16 additions and 15 deletions
|
|
@ -251,12 +251,7 @@ class UIViewModel @Inject constructor(
|
|||
fun updateMapCenterAndZoom(center: GeoPoint, zoom: Double) =
|
||||
_mapState.update { it.copy(center = center, zoom = zoom) }
|
||||
|
||||
fun getUser(userId: String?) = nodeDB.getUser(userId) ?: user {
|
||||
id = userId.orEmpty()
|
||||
longName = app.getString(R.string.unknown_username)
|
||||
shortName = app.getString(R.string.unknown_node_short_name)
|
||||
hwModel = MeshProtos.HardwareModel.UNSET
|
||||
}
|
||||
fun getUser(userId: String?) = nodeDB.getUser(userId ?: DataPacket.ID_BROADCAST)
|
||||
|
||||
private val _snackbarText = MutableLiveData<Any?>(null)
|
||||
val snackbarText: LiveData<Any?> get() = _snackbarText
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue