Move service worker into platform

This commit is contained in:
J. Ryan Stinnett 2021-01-15 12:25:21 +00:00
parent 87e67d8168
commit e077d9ca5f
3 changed files with 8 additions and 5 deletions

View file

@ -38,6 +38,12 @@ export default class WebPlatform extends VectorBasePlatform {
return 'Web Platform'; // no translation required: only used for analytics
}
registerServiceWorker(): void {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
}
/**
* Returns true if the platform supports displaying
* notifications, otherwise false.