Skip to content

Commit

Permalink
Prevent the flashing of 'Unknown error' when index is loaded but main…
Browse files Browse the repository at this point in the history
…_menu is not created
  • Loading branch information
emericklaw committed Jun 5, 2024
1 parent 9ec0459 commit d1325a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/firmware_apps/app_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def exit_available_menu():
item_font_size=ten_pt,
)


def prepare_main_menu(self):
def on_cancel():
self.minimise()
Expand Down Expand Up @@ -213,8 +212,6 @@ def uninstall_app(self, app):
eventbus.emit(InstallNotificationEvent())
machine.reset()



def error_screen(self, ctx, message):
ctx.save()
ctx.text_align = ctx.CENTER
Expand Down Expand Up @@ -268,6 +265,8 @@ def draw(self, ctx):
clear_background(ctx)
if self.state == "main_menu" and self.menu:
self.menu.draw(ctx)
elif self.state == "main_menu" and not self.menu:
self.error_screen(ctx, "Loading...")
elif self.state == "available_menu" and self.available_menu:
self.available_menu.draw(ctx)
elif self.state == "installed_menu" and self.installed_menu:
Expand All @@ -284,6 +283,8 @@ def draw(self, ctx):
self.error_screen(ctx, "Connecting\nWi-Fi...\n")
elif self.state == "refreshing_index":
self.error_screen(ctx, "Refreshing\napp store\nindex")
elif self.state == "index_received":
self.error_screen(ctx, "App store\nindex\nreceived")
elif self.state == "install_oom":
self.error_screen(ctx, "Out of memory\n(app too big?)")
elif self.state == "code_install_input" and self.codeinstall:
Expand Down

0 comments on commit d1325a8

Please sign in to comment.