2019-07-02 08:10:25 +01:00
|
|
|
'use strict';
|
|
|
|
|
2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2019-07-02 08:10:25 +01:00
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import ready from './ready';
|
2020-08-17 21:07:16 +01:00
|
|
|
import * as registerPushNotifications from './actions/push_notifications';
|
|
|
|
import { default as GabSocial, store } from './containers/gabsocial';
|
2019-07-02 08:10:25 +01:00
|
|
|
|
|
|
|
function main() {
|
|
|
|
ready(() => {
|
|
|
|
const mountNode = document.getElementById('gabsocial');
|
|
|
|
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
|
|
|
|
|
|
|
ReactDOM.render(<GabSocial {...props} />, mountNode);
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
2020-04-11 23:29:19 +01:00
|
|
|
// Avoid offline in dev mode because it's harder to debug
|
2019-07-02 08:10:25 +01:00
|
|
|
require('offline-plugin/runtime').install();
|
|
|
|
store.dispatch(registerPushNotifications.register());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default main;
|