many small improvements
This commit is contained in:
@ -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
|
||||
|
Binary file not shown.
@ -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);
|
||||
}
|
||||
}));
|
||||
})
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user