mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
OSUpdate: make sure still foreground before showing update info
This commit is contained in:
@@ -194,11 +194,12 @@ class OSUpdate(Activity):
|
|||||||
try:
|
try:
|
||||||
# Use UpdateChecker to fetch update info
|
# Use UpdateChecker to fetch update info
|
||||||
update_info = self.update_checker.fetch_update_info(hwid)
|
update_info = self.update_checker.fetch_update_info(hwid)
|
||||||
self.handle_update_info(
|
if self.has_foreground():
|
||||||
update_info["version"],
|
self.handle_update_info(
|
||||||
update_info["download_url"],
|
update_info["version"],
|
||||||
update_info["changelog"]
|
update_info["download_url"],
|
||||||
)
|
update_info["changelog"]
|
||||||
|
)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
# JSON parsing or validation error (not network related)
|
# JSON parsing or validation error (not network related)
|
||||||
self.set_state(UpdateState.ERROR)
|
self.set_state(UpdateState.ERROR)
|
||||||
|
|||||||
Reference in New Issue
Block a user