2024-03-07 01:28:18 +08:00
|
|
|
import React from 'react';
|
|
|
|
import ConnectionManager from '/imports/ui/components/connection-manager/component';
|
2024-09-13 01:34:36 +08:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2024-03-07 01:28:18 +08:00
|
|
|
import SettingsLoader from '/imports/ui/components/settings-loader/component';
|
|
|
|
import ErrorBoundary from '/imports/ui/components/common/error-boundary/component';
|
|
|
|
import { ErrorScreen } from '/imports/ui/components/error-screen/component';
|
|
|
|
import PresenceManager from '/imports/ui/components/join-handler/presenceManager/component';
|
|
|
|
import LoadingScreenHOC from '/imports/ui/components/common/loading-screen/loading-screen-HOC/component';
|
2024-03-23 03:07:49 +08:00
|
|
|
import IntlLoaderContainer from '/imports/startup/client/intlLoader';
|
2024-03-23 03:18:32 +08:00
|
|
|
import LocatedErrorBoundary from '/imports/ui/components/common/error-boundary/located-error-boundary/component';
|
2024-07-16 21:40:13 +08:00
|
|
|
import CustomUsersSettings from '/imports/ui/components/join-handler/custom-users-settings/component';
|
|
|
|
import MeetingClient from '/client/meetingClient';
|
2024-05-01 19:38:12 +08:00
|
|
|
|
2024-05-03 23:27:17 +08:00
|
|
|
const STARTUP_CRASH_METADATA = { logCode: 'app_startup_crash', logMessage: 'Possible startup crash' };
|
|
|
|
const APP_CRASH_METADATA = { logCode: 'app_crash', logMessage: 'Possible app crash' };
|
2024-08-30 22:04:46 +08:00
|
|
|
/* eslint-disable */
|
|
|
|
if (
|
|
|
|
process.env.NODE_ENV === 'production'
|
|
|
|
// @ts-ignore
|
|
|
|
&& window.__REACT_DEVTOOLS_GLOBAL_HOOK__
|
|
|
|
) {
|
|
|
|
// @ts-ignore
|
|
|
|
for (const prop in window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
|
|
|
if (prop === 'renderers') {
|
|
|
|
// @ts-ignore
|
|
|
|
// prevents console error when dev tools try to iterate of renderers
|
|
|
|
window.__REACT_DEVTOOLS_GLOBAL_HOOK__[prop] = new Map();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// @ts-ignore
|
|
|
|
window.__REACT_DEVTOOLS_GLOBAL_HOOK__[prop] = typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__[prop] === 'function'
|
|
|
|
? Function.prototype
|
|
|
|
: null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* eslint-enable */
|
2024-05-03 23:27:17 +08:00
|
|
|
|
2024-03-07 01:28:18 +08:00
|
|
|
const Main: React.FC = () => {
|
|
|
|
return (
|
2024-07-16 21:40:13 +08:00
|
|
|
<SettingsLoader>
|
2024-09-11 03:00:47 +08:00
|
|
|
<ErrorBoundary
|
|
|
|
Fallback={ErrorScreen}
|
|
|
|
logMetadata={STARTUP_CRASH_METADATA}
|
|
|
|
isCritical
|
|
|
|
>
|
2024-03-07 01:28:18 +08:00
|
|
|
<LoadingScreenHOC>
|
2024-03-23 03:07:49 +08:00
|
|
|
<IntlLoaderContainer>
|
|
|
|
{/* from there the error messages are located */}
|
2024-09-11 03:00:47 +08:00
|
|
|
<LocatedErrorBoundary
|
|
|
|
Fallback={ErrorScreen}
|
|
|
|
logMetadata={APP_CRASH_METADATA}
|
|
|
|
isCritical
|
|
|
|
>
|
2024-03-23 03:07:49 +08:00
|
|
|
<ConnectionManager>
|
|
|
|
<PresenceManager>
|
2024-07-30 20:35:47 +08:00
|
|
|
<CustomUsersSettings>
|
|
|
|
<MeetingClient />
|
|
|
|
</CustomUsersSettings>
|
2024-03-23 03:07:49 +08:00
|
|
|
</PresenceManager>
|
|
|
|
</ConnectionManager>
|
|
|
|
</LocatedErrorBoundary>
|
|
|
|
</IntlLoaderContainer>
|
2024-03-07 01:28:18 +08:00
|
|
|
</LoadingScreenHOC>
|
|
|
|
</ErrorBoundary>
|
2024-07-16 21:40:13 +08:00
|
|
|
</SettingsLoader>
|
2024-03-07 01:28:18 +08:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-09-13 01:34:36 +08:00
|
|
|
const container = document.getElementById('app');
|
|
|
|
const root = createRoot(container!);
|
|
|
|
root.render(<Main />);
|