2020-03-07 00:27:45 +08:00
|
|
|
/*
|
|
|
|
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
|
|
|
|
2020-05-12 21:31:00 +08:00
|
|
|
Copyright (c) 2020 BigBlueButton Inc. and by respective authors (see below).
|
2020-03-07 00:27:45 +08:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the
|
|
|
|
terms of the GNU Lesser General Public License as published by the Free Software
|
|
|
|
Foundation; either version 3.0 of the License, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2017-10-24 21:01:58 +08:00
|
|
|
/* eslint no-unused-vars: 0 */
|
2021-08-18 00:59:18 +08:00
|
|
|
|
2016-05-04 04:40:46 +08:00
|
|
|
import React from 'react';
|
2016-04-29 03:02:51 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
2023-06-28 21:38:25 +08:00
|
|
|
import { render } from 'react-dom';
|
2018-06-20 00:46:59 +08:00
|
|
|
import logger from '/imports/startup/client/logger';
|
2022-02-17 08:51:39 +08:00
|
|
|
import '/imports/ui/services/mobile-app';
|
2018-09-21 23:43:10 +08:00
|
|
|
import Base from '/imports/startup/client/base';
|
2018-11-15 01:11:10 +08:00
|
|
|
import JoinHandler from '/imports/ui/components/join-handler/component';
|
|
|
|
import AuthenticatedHandler from '/imports/ui/components/authenticated-handler/component';
|
2019-04-25 04:48:16 +08:00
|
|
|
import Subscriptions from '/imports/ui/components/subscriptions/component';
|
2020-05-12 21:31:00 +08:00
|
|
|
import IntlStartup from '/imports/startup/client/intl';
|
2021-01-20 01:06:32 +08:00
|
|
|
import ContextProviders from '/imports/ui/components/context-providers/component';
|
|
|
|
import ChatAdapter from '/imports/ui/components/components-data/chat-context/adapter';
|
|
|
|
import UsersAdapter from '/imports/ui/components/components-data/users-context/adapter';
|
2023-04-06 03:18:04 +08:00
|
|
|
import GraphqlProvider from '/imports/ui/components/graphql-provider/component';
|
2021-10-20 04:35:39 +08:00
|
|
|
import { liveDataEventBrokerInitializer } from '/imports/ui/services/LiveDataEventBroker/LiveDataEventBroker';
|
2022-04-26 01:02:53 +08:00
|
|
|
// The adapter import is "unused" as far as static code is concerned, but it
|
|
|
|
// needs to here to override global prototypes. So: don't remove it - prlanzarin 25 Apr 2022
|
|
|
|
import adapter from 'webrtc-adapter';
|
2016-05-12 04:43:07 +08:00
|
|
|
|
2021-10-20 04:35:39 +08:00
|
|
|
import collectionMirrorInitializer from './collection-mirror-initializer';
|
2021-09-07 04:51:42 +08:00
|
|
|
|
2021-09-02 00:22:43 +08:00
|
|
|
import('/imports/api/audio/client/bridge/bridge-whitelist').catch(() => {
|
|
|
|
// bridge loading
|
|
|
|
});
|
2021-09-02 00:22:43 +08:00
|
|
|
|
2022-09-22 00:13:49 +08:00
|
|
|
const { disableWebsocketFallback } = Meteor.settings.public.app;
|
2022-09-21 05:34:29 +08:00
|
|
|
|
2022-09-21 22:03:21 +08:00
|
|
|
if (disableWebsocketFallback) {
|
2023-04-06 03:18:04 +08:00
|
|
|
Meteor.connection._stream._sockjsProtocolsWhitelist = function () { return ['websocket']; };
|
2022-09-21 22:03:21 +08:00
|
|
|
|
|
|
|
Meteor.disconnect();
|
|
|
|
Meteor.reconnect();
|
|
|
|
}
|
2022-09-21 05:34:29 +08:00
|
|
|
|
2021-10-20 04:35:39 +08:00
|
|
|
collectionMirrorInitializer();
|
|
|
|
liveDataEventBrokerInitializer();
|
2021-12-10 04:37:05 +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
|
2017-10-24 20:59:23 +08:00
|
|
|
window.addEventListener('error', (e) => {
|
2019-06-25 05:11:38 +08:00
|
|
|
let message = e.message || e.error.toString();
|
|
|
|
|
|
|
|
// Chrome will add on "Uncaught" to the start of the message for some reason. This
|
|
|
|
// will strip that so the errors can hopefully be grouped better.
|
|
|
|
if (message) message = message.replace(/^Uncaught/, '').trim();
|
|
|
|
|
|
|
|
let { stack } = e.error;
|
2018-06-20 00:46:59 +08:00
|
|
|
|
|
|
|
// Checks if stack includes the message, if not add the two together.
|
2019-06-25 05:11:38 +08:00
|
|
|
if (!stack.includes(message)) {
|
|
|
|
stack = `${message}\n${stack}`;
|
2018-10-25 23:51:53 +08:00
|
|
|
}
|
2019-07-31 20:30:34 +08:00
|
|
|
logger.error({
|
|
|
|
logCode: 'startup_error',
|
|
|
|
extraInfo: {
|
|
|
|
stackTrace: stack,
|
|
|
|
},
|
|
|
|
}, message);
|
2017-10-24 20:59:23 +08:00
|
|
|
});
|
2018-09-21 23:43:10 +08:00
|
|
|
|
|
|
|
// TODO make this a Promise
|
2023-06-28 21:38:25 +08:00
|
|
|
render(
|
2021-01-20 01:06:32 +08:00
|
|
|
<ContextProviders>
|
2023-04-06 03:18:04 +08:00
|
|
|
<>
|
2021-01-20 01:06:32 +08:00
|
|
|
<JoinHandler>
|
|
|
|
<AuthenticatedHandler>
|
2023-04-06 03:18:04 +08:00
|
|
|
<GraphqlProvider>
|
|
|
|
<Subscriptions>
|
|
|
|
<IntlStartup>
|
|
|
|
<Base />
|
|
|
|
</IntlStartup>
|
|
|
|
</Subscriptions>
|
|
|
|
</GraphqlProvider>
|
2021-01-20 01:06:32 +08:00
|
|
|
</AuthenticatedHandler>
|
|
|
|
</JoinHandler>
|
|
|
|
<UsersAdapter />
|
|
|
|
<ChatAdapter />
|
2023-04-06 03:18:04 +08:00
|
|
|
</>
|
2021-01-20 01:06:32 +08:00
|
|
|
</ContextProviders>,
|
2023-06-28 21:38:25 +08:00
|
|
|
document.getElementById('app'),
|
2018-11-15 01:11:10 +08:00
|
|
|
);
|
2016-01-13 04:15:16 +08:00
|
|
|
});
|