bigbluebutton-Github/bigbluebutton-html5/client/main.jsx

35 lines
1009 B
React
Raw Normal View History

/* eslint no-unused-vars: 0 */
import React from 'react';
2016-04-29 03:02:51 +08:00
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
2018-06-20 00:46:59 +08:00
import logger from '/imports/startup/client/logger';
2018-09-21 23:43:10 +08:00
import Base from '/imports/startup/client/base';
import JoinHandler from '/imports/ui/components/join-handler/component';
import AuthenticatedHandler from '/imports/ui/components/authenticated-handler/component';
2016-05-12 04:43:07 +08:00
2016-01-13 04:15:16 +08:00
Meteor.startup(() => {
2018-06-20 00:46:59 +08:00
// Logs all uncaught exceptions to the client logger
window.addEventListener('error', (e) => {
2018-10-03 03:53:13 +08:00
const { stack } = e.error;
2018-06-20 00:46:59 +08:00
let message = e.error.toString();
// Checks if stack includes the message, if not add the two together.
if (stack.includes(message)) {
message = stack;
} else {
message += `\n${stack}`;
}
2018-06-20 00:46:59 +08:00
logger.error(message);
});
2018-09-21 23:43:10 +08:00
// TODO make this a Promise
render(
<JoinHandler >
<AuthenticatedHandler>
<Base />
</AuthenticatedHandler>
</JoinHandler>,
document.getElementById('app'),
);
2016-01-13 04:15:16 +08:00
});