don't try to access serviceworker if it doesn't exist

This commit is contained in:
Henry Jameson 2025-06-28 21:16:21 +03:00
commit ec367ad761

View file

@ -18,6 +18,7 @@ function isPushSupported () {
}
function getOrCreateServiceWorker () {
if (!isSWSupported()) return
const swType = process.env.HAS_MODULE_SERVICE_WORKER ? 'module' : 'classic'
return navigator.serviceWorker.register('/sw-pleroma.js', { type: swType })
.catch((err) => console.error('Unable to get or create a service worker.', err))