kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix(config): show error when radio disconnects before receiving confirmation
rodzic
abcc2e89ec
commit
8af78bc2eb
|
@ -100,6 +100,12 @@ class RadioConfigViewModel @Inject constructor(
|
||||||
radioConfigRepository.meshPacketFlow.onEach(::processPacketResponse)
|
radioConfigRepository.meshPacketFlow.onEach(::processPacketResponse)
|
||||||
.launchIn(viewModelScope)
|
.launchIn(viewModelScope)
|
||||||
|
|
||||||
|
combine(connectionState, radioConfigState) { connState, configState ->
|
||||||
|
if (connState.isDisconnected() && configState.responseState.isWaiting()) {
|
||||||
|
setResponseStateError(app.getString(R.string.disconnected))
|
||||||
|
}
|
||||||
|
}.launchIn(viewModelScope)
|
||||||
|
|
||||||
debug("RadioConfigViewModel created")
|
debug("RadioConfigViewModel created")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,10 @@ class MeshService : Service(), Logging {
|
||||||
enum class ConnectionState {
|
enum class ConnectionState {
|
||||||
DISCONNECTED,
|
DISCONNECTED,
|
||||||
CONNECTED,
|
CONNECTED,
|
||||||
DEVICE_SLEEP // device is in LS sleep state, it will reconnected to us over bluetooth once it has data
|
DEVICE_SLEEP, // device is in LS sleep state, it will reconnected to us over bluetooth once it has data
|
||||||
|
;
|
||||||
|
|
||||||
|
fun isDisconnected() = this == DISCONNECTED
|
||||||
}
|
}
|
||||||
|
|
||||||
private var previousSummary: String? = null
|
private var previousSummary: String? = null
|
||||||
|
|
Ładowanie…
Reference in New Issue