about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/main.js
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-04-14 19:22:47 -0500
committerStarfall <us@starfall.systems>2023-04-14 19:22:47 -0500
commit4fe1689de43f4404eb9530fcfbcbfb26d6c1c13a (patch)
tree6811b845bb7f4966b10dcefa3dea404246f161c7 /app/javascript/flavours/glitch/main.js
parent65c1e53a32cabcdbb7bca57002bb0f6acdebe07e (diff)
parentbed63f6dae0879ac840066b031229e0d139089cd (diff)
Merge remote-tracking branch 'glitch/main' HEAD main
Diffstat (limited to 'app/javascript/flavours/glitch/main.js')
-rw-r--r--app/javascript/flavours/glitch/main.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/app/javascript/flavours/glitch/main.js b/app/javascript/flavours/glitch/main.js
deleted file mode 100644
index 14a6effbb..000000000
--- a/app/javascript/flavours/glitch/main.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-import { setupBrowserNotifications } from 'flavours/glitch/actions/notifications';
-import Mastodon, { store } from 'flavours/glitch/containers/mastodon';
-import { me } from 'flavours/glitch/initial_state';
-import ready from 'flavours/glitch/ready';
-
-const perf = require('flavours/glitch/performance');
-
-/**
- * @returns {Promise<void>}
- */
-function main() {
-  perf.start('main()');
-
-  return ready(async () => {
-    const mountNode = document.getElementById('mastodon');
-    const props = JSON.parse(mountNode.getAttribute('data-props'));
-
-    ReactDOM.render(<Mastodon {...props} />, mountNode);
-    store.dispatch(setupBrowserNotifications());
-
-    if (process.env.NODE_ENV === 'production' && me && 'serviceWorker' in navigator) {
-      const { Workbox } = await import('workbox-window');
-      const wb = new Workbox('/sw.js');
-      /** @type {ServiceWorkerRegistration} */
-      let registration;
-
-      try {
-        registration = await wb.register();
-      } catch (err) {
-        console.error(err);
-      }
-
-      if (registration) {
-        const registerPushNotifications = await import('flavours/glitch/actions/push_notifications');
-
-        store.dispatch(registerPushNotifications.register());
-      }
-    }
-
-    perf.stop('main()');
-  });
-}
-
-export default main;