Skip to content
Snippets Groups Projects
Unverified Commit 894ce372 authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix unnecessary service worker registration and preloading when logged out (#20341)

parent 39784545
No related branches found
No related tags found
No related merge requests found
......@@ -25,17 +25,17 @@ function main() {
import('mastodon/initial_state'),
]);
const wb = new Workbox('/sw.js');
if (me) {
const wb = new Workbox('/sw.js');
try {
await wb.register();
} catch (err) {
console.error(err);
try {
await wb.register();
} catch (err) {
console.error(err);
return;
}
return;
}
if (me) {
const registerPushNotifications = await import('mastodon/actions/push_notifications');
store.dispatch(registerPushNotifications.register());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment