about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/flavours/glitch/main.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/javascript/flavours/glitch/main.js b/app/javascript/flavours/glitch/main.js
index f1e10df34..b8095f819 100644
--- a/app/javascript/flavours/glitch/main.js
+++ b/app/javascript/flavours/glitch/main.js
@@ -25,17 +25,17 @@ function main() {
         import('flavours/glitch/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('flavours/glitch/actions/push_notifications');
 
         store.dispatch(registerPushNotifications.register());