Skip to content

Commit ce9354a

Browse files
appstore: reduce icon delay
1 parent d4eb0b6 commit ce9354a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

appstore_backend/apps.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@
5151
"category": "art"
5252
}
5353

54+
,{
55+
"name": "HelloWorld",
56+
"publisher": "ACME Inc",
57+
"short_description": "Minimal app",
58+
"long_description": "Demonstrates the simplest app.",
59+
"icon_url": "http://demo.lnpiggy.com:2121/apps/com.example.helloworld_0.0.1.mpk_icon_64x64.png",
60+
"download_url": "http://demo.lnpiggy.com:2121/apps/com.example.helloworld_0.0.1.mpk",
61+
"fullname": "com.example.helloworld",
62+
"version": "0.0.1",
63+
"entrypoint": "assets/hello.py",
64+
"category": "development"
65+
}
5466
,{
5567
"name": "IMU Tester",
5668
"publisher": "ACME Inc",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ def download_apps(json_url):
241241

242242
def download_icons():
243243
for app in apps:
244-
print("Downloading icon for app ")
244+
print(f"Downloading icon for {app.name}")
245245
image_dsc = download_icon(app.icon_url)
246246
app.image_dsc = image_dsc # save it for the app detail page
247-
lv.async_call(lambda l, id=app.image_dsc: app.image.set_src(id), None)
248-
time.sleep_ms(50) # wait until image updated
247+
lv.async_call(lambda l: app.image.set_src(image_dsc), None)
248+
time.sleep_ms(round(th.duration*1.5)) # not waiting here will result in some async_calls() not being executed
249249
print("Finished downloading icons...")
250250

251251

0 commit comments

Comments
 (0)