mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor(repository)!: improve api caching and error handling (#2680)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
9bde1f6357
commit
07cdbacf8f
4 changed files with 161 additions and 86 deletions
|
|
@ -230,7 +230,9 @@ constructor(
|
|||
val deviceHardware: StateFlow<DeviceHardware?> =
|
||||
ourNodeInfo
|
||||
.mapNotNull { nodeInfo ->
|
||||
nodeInfo?.user?.hwModel?.let { deviceHardwareRepository.getDeviceHardwareByModel(it.number) }
|
||||
nodeInfo?.user?.hwModel?.let {
|
||||
deviceHardwareRepository.getDeviceHardwareByModel(it.number).getOrNull()
|
||||
}
|
||||
}
|
||||
.stateIn(scope = viewModelScope, started = SharingStarted.WhileSubscribed(5_000), initialValue = null)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue