many small improvements

This commit is contained in:
2023-06-04 18:51:06 +02:00
parent 95c4319340
commit cf144e5b28
20 changed files with 583 additions and 74 deletions

View File

@ -20,6 +20,8 @@ toast_container.position_end = 0
def onclick(_):
# NOTE: you can also use app.toast(...) and app.alert_success(...) to show toasts
# and alerts at the default bottom right position
alert = bHTML.AlertSuccess("You clicked me!", parent=app.main)
alert.w = 25
toast = bHTML.Toast("You clicked me!", parent=toast_container)
@ -27,4 +29,3 @@ def onclick(_):
toast.show()
btn.onclick = onclick

View File

@ -1,5 +1,5 @@
const pwa_version = "01_hello_world_202306031006"
const pwa_version = "01_hello_world_202306041650"
const assets = ["./index.html",
"./main.py",
"./resources/bootstrap.css",
@ -48,4 +48,15 @@ self.addEventListener('fetch', event => {
return response;
})());
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((keyList) => {
return Promise.all(keyList.map((key) => {
if(key !== pwa_version) {
return caches.delete(key);
}
}));
})
);
});