fix message not allowed to be queued while sleeping (I think)

1.2-legacy
Kevin Hester 2021-04-02 13:56:09 +08:00
rodzic 7e21d63044
commit 28fec09a54
2 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -1465,7 +1465,7 @@ class MeshService : Service(), Logging {
/// If we've received our initial config, our radio settings and all of our channels, send any queueed packets and broadcast connected to clients
private fun onHasSettings() {
processEarlyPackets() // send receive any packets that were queued up
processEarlyPackets() // send any packets that were queued up
// broadcast an intent with our new connection state
serviceBroadcasts.broadcastConnection()

Wyświetl plik

@ -252,7 +252,10 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
// If connection state _OR_ myID changes we have to fix our ability to edit outgoing messages
fun updateTextEnabled() {
binding.textInputLayout.isEnabled =
model.isConnected.value != MeshService.ConnectionState.DISCONNECTED && model.nodeDB.myId.value != null && model.radioConfig.value != null
model.isConnected.value != MeshService.ConnectionState.DISCONNECTED
// Just being connected is enough to allow sending texts I think
// && model.nodeDB.myId.value != null && model.radioConfig.value != null
}
model.isConnected.observe(viewLifecycleOwner, Observer { _ ->
@ -260,7 +263,7 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
updateTextEnabled()
})
model.nodeDB.myId.observe(viewLifecycleOwner, Observer { _ ->
/* model.nodeDB.myId.observe(viewLifecycleOwner, Observer { _ ->
// If we don't know our node ID and we are offline don't let user try to send
updateTextEnabled()
})
@ -268,7 +271,7 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
model.radioConfig.observe(viewLifecycleOwner, Observer { _ ->
// If we don't know our node ID and we are offline don't let user try to send
updateTextEnabled()
})
}) */
}
}