1 import * as registerPushNotifications
from 'flavours/glitch/actions/push_notifications';
2 import { default as Mastodon
, store
} from 'flavours/glitch/containers/mastodon';
3 import React
from 'react';
4 import ReactDOM
from 'react-dom';
5 import ready
from './ready';
7 const perf
= require('./performance');
12 if (window
.history
&& history
.replaceState
) {
13 const { pathname
, search
, hash
} = window
.location
;
14 const path
= pathname
+ search
+ hash
;
15 if (!(/^\/web[$/]/).test(path
)) {
16 history
.replaceState(null, document
.title
, `/web${path}`);
21 const mountNode
= document
.getElementById('mastodon');
22 const props
= JSON
.parse(mountNode
.getAttribute('data-props'));
24 ReactDOM
.render(<Mastodon
{...props
} />, mountNode
);
25 if (process
.env
.NODE_ENV
=== 'production') {
26 // avoid offline in dev mode because it's harder to debug
27 require('offline-plugin/runtime').install();
28 store
.dispatch(registerPushNotifications
.register());