Skip to content

Commit 87f3bfe

Browse files
AppStore app: don't create unnecessary additional thread
1 parent 51e702b commit 87f3bfe

File tree

1 file changed

+1
-5
lines changed
  • internal_filesystem/builtin/apps/com.micropythonos.appstore/assets

1 file changed

+1
-5
lines changed

internal_filesystem/builtin/apps/com.micropythonos.appstore/assets/appstore.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def download_app_index(self, json_url):
7070
time.sleep_ms(200)
7171
self.update_ui_threadsafe_if_foreground(self.please_wait_label.add_flag, lv.obj.FLAG.HIDDEN)
7272
self.update_ui_threadsafe_if_foreground(self.create_apps_list)
73+
self.download_icons()
7374
except Exception as e:
7475
print(f"ERROR: could not parse reponse.text JSON: {e}")
7576
finally:
@@ -119,11 +120,6 @@ def create_apps_list(self):
119120
desc_label.set_style_text_font(lv.font_montserrat_12, 0)
120121
desc_label.add_event_cb(lambda e, a=app: self.show_app_detail(a), lv.EVENT.CLICKED, None)
121122
print("create_apps_list app done")
122-
try:
123-
_thread.stack_size(mpos.apps.good_stack_size())
124-
_thread.start_new_thread(self.download_icons,()) # maybe there's no need for a new thread here, just do it in download_app_index()?
125-
except Exception as e:
126-
print("Could not start thread to download icons: ", e)
127123

128124
def download_icons(self):
129125
for app in self.apps:

0 commit comments

Comments
 (0)