fix software update button

1.2-legacy
geeksville 2020-07-02 10:37:35 -07:00
rodzic 7bd6615cb7
commit 7faf4d2d79
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -2,7 +2,6 @@
- add faq entry about range and antennas and rain
- first message sent is still doubled for some people
- disable software update button after update finishes
- let users set arbitrary params in android
- add a low level settings screen (let user change any of the RadioConfig parameters)

Wyświetl plik

@ -484,10 +484,12 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
updateProgressBar.progress = service.updateStatus
delay(2000) // Only check occasionally
}
val isSuccess = (service.updateStatus == -1)
scanStatusText.text =
if (service.updateStatus == -1) "Update successful" else "Update failed"
if (isSuccess) "Update successful" else "Update failed"
updateProgressBar.isEnabled = false
updateFirmwareButton.isEnabled = true
updateFirmwareButton.isEnabled = !isSuccess
}
}
}