2016-12-14 10:32:36 +00:00
|
|
|
/* global APP */
|
2017-01-10 21:55:31 +00:00
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
|
2017-04-28 20:24:20 +00:00
|
|
|
import { getJitsiMeetTransport } from '../modules/transport';
|
2017-04-17 15:52:31 +00:00
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
import { App } from './features/app';
|
|
|
|
|
2016-12-14 10:32:36 +00:00
|
|
|
const logger = require('jitsi-meet-logger').getLogger(__filename);
|
|
|
|
|
|
|
|
/**
|
2017-01-10 21:55:31 +00:00
|
|
|
* 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);
|
|
|
|
|
2017-06-09 19:09:23 +00:00
|
|
|
// Render the main/root Component.
|
2017-06-09 10:26:21 +00:00
|
|
|
ReactDOM.render(<App />, document.getElementById('react'));
|
2016-12-14 10:32:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
2017-01-10 21:55:31 +00:00
|
|
|
* 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();
|
2017-04-28 20:24:20 +00:00
|
|
|
getJitsiMeetTransport().dispose();
|
2016-12-14 10:32:36 +00:00
|
|
|
});
|