mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-04 12:27:28 +02:00
seriveworkerregistration: show alert when new content available
This commit is contained in:
@@ -49,6 +49,11 @@ if (
|
|||||||
// It's the perfect time to display a "New content is available; please refresh."
|
// It's the perfect time to display a "New content is available; please refresh."
|
||||||
// message in the page's interface.
|
// message in the page's interface.
|
||||||
console.log('New or updated content is available.');
|
console.log('New or updated content is available.');
|
||||||
|
if (window.alertsService) {
|
||||||
|
window.alertsService.add(
|
||||||
|
'New version available. Please refresh the page.'
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// At this point, everything has been precached.
|
// At this point, everything has been precached.
|
||||||
// It's the perfect time to display a "Content is cached for offline use." message.
|
// It's the perfect time to display a "Content is cached for offline use." message.
|
||||||
|
Reference in New Issue
Block a user