Fix autobug, don't show update button if we can't find the filename

This commit is contained in:
geeksville 2020-07-02 10:21:14 -07:00
parent 36949b83e5
commit 0006858469
3 changed files with 4 additions and 1 deletions

View file

@ -1461,6 +1461,8 @@ class MeshService : Service(), Logging {
errormsg("Unable to update", ex)
null
}
debug("setFirmwareUpdateFilename $firmwareUpdateFilename")
}
private fun doFirmwareUpdate() {

View file

@ -504,7 +504,7 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
// If actively connected possibly let the user update firmware
val info = model.myNodeInfo.value
if (connected == MeshService.ConnectionState.CONNECTED && info != null && info.shouldUpdate) {
if (connected == MeshService.ConnectionState.CONNECTED && info != null && info.shouldUpdate && info.couldUpdate) {
updateFirmwareButton.visibility = View.VISIBLE
updateFirmwareButton.text =
getString(R.string.update_to).format(getString(R.string.cur_firmware_version))