mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-30 12:09:04 +01:00
[Glitch] Fix unnecessary service worker registration and preloading when logged out
Port 894ce3726a
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
487689f062
commit
5394ca6807
1 changed files with 10 additions and 10 deletions
|
@ -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 a new issue