[Glitch] Fix unnecessary service worker registration and preloading when logged out
Port 9b878a14eb
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
parent
d4f1b79bcf
commit
b5481c4ba2
|
@ -25,17 +25,17 @@ function main() {
|
|||
import('flavours/glitch/initial_state'),
|
||||
]);
|
||||
|
||||
const wb = new Workbox('/sw.js');
|
||||
|
||||
try {
|
||||
await wb.register();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (me) {
|
||||
const wb = new Workbox('/sw.js');
|
||||
|
||||
try {
|
||||
await wb.register();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const registerPushNotifications = await import('flavours/glitch/actions/push_notifications');
|
||||
|
||||
store.dispatch(registerPushNotifications.register());
|
||||
|
|
Loading…
Reference in New Issue