sforkowany z mirror/meshtastic-android
fix: replace filterNotNull() with null check
rodzic
70f7ffb5fc
commit
29d3572507
|
@ -40,7 +40,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
|
@ -157,8 +156,9 @@ class UIViewModel @Inject constructor(
|
|||
_ourNodeInfo.value = it
|
||||
}.launchIn(viewModelScope)
|
||||
|
||||
combine(meshLog, requestId.filterNotNull()) { packet, id ->
|
||||
_packetResponse.value = packet.firstOrNull { it.meshPacket?.decoded?.requestId == id }
|
||||
combine(meshLog, requestId) { packet, requestId ->
|
||||
if (requestId != null) _packetResponse.value =
|
||||
packet.firstOrNull { it.meshPacket?.decoded?.requestId == requestId }
|
||||
}.launchIn(viewModelScope)
|
||||
|
||||
debug("ViewModel created")
|
||||
|
|
Ładowanie…
Reference in New Issue