jiti-meet/react/index.web.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

2016-12-14 10:32:36 +00:00
/* global APP */
import React from 'react';
import ReactDOM from 'react-dom';
import { getJitsiMeetTransport } from '../modules/transport';
import config from './config';
import { App } from './features/app';
2016-12-14 10:32:36 +00:00
const logger = require('jitsi-meet-logger').getLogger(__filename);
/**
* Renders the app when the DOM tree has been loaded.
2016-12-14 10:32:36 +00:00
*/
document.addEventListener('DOMContentLoaded', () => {
const now = window.performance.now();
APP.connectionTimes['document.ready'] = now;
logger.log('(TIME) document ready:\t', now);
// Render the main Component.
ReactDOM.render(
<App config = { config } />,
2016-12-14 10:32:36 +00:00
document.getElementById('react'));
});
/**
* Stops collecting the logs and disposing the API when the user closes the
* page.
2016-12-14 10:32:36 +00:00
*/
window.addEventListener('beforeunload', () => {
// Stop the LogCollector
if (APP.logCollectorStarted) {
APP.logCollector.stop();
APP.logCollectorStarted = false;
}
APP.API.dispose();
getJitsiMeetTransport().dispose();
2016-12-14 10:32:36 +00:00
});