OSUpdate app: fix typo that caused update failure

This commit is contained in:
Thomas Farstrike
2025-11-08 09:52:59 +01:00
parent c5e8acaa2e
commit b33b40c902
@@ -183,7 +183,6 @@ class OSUpdate(Activity):
response.close()
try:
if bytes_written >= total_size:
lv.update_ui_threadsafe_if_foreground(self.status_label.set_text, "Update finished! Please restart.")
if not simulate: # if the update was completely installed
next_partition.set_boot()
import machine
@@ -191,6 +190,7 @@ class OSUpdate(Activity):
# self.install_button stays disabled to prevent the user from installing the same update twice
else:
print("This is an OSUpdate simulation, not attempting to restart the device.")
self.update_ui_threadsafe_if_foreground(self.status_label.set_text, "Update finished! Please restart.")
else:
self.update_ui_threadsafe_if_foreground(self.status_label.set_text, f"Wrote {bytes_written} < {total_size} so not enough!")
self.update_ui_threadsafe_if_foreground(self.install_button.remove_state, lv.STATE.DISABLED) # allow retry