2024-03-07 01:28:18 +08:00
|
|
|
import React, {
|
|
|
|
Suspense,
|
|
|
|
useContext,
|
|
|
|
useEffect,
|
|
|
|
} from 'react';
|
|
|
|
import { LoadingContext } from '/imports/ui/components/common/loading-screen/loading-screen-HOC/component';
|
2024-03-22 03:41:32 +08:00
|
|
|
import logger from '/imports/startup/client/logger';
|
2024-03-07 01:28:18 +08:00
|
|
|
|
|
|
|
const MeetingClientLazy = React.lazy(() => import('./meetingClient'));
|
|
|
|
|
|
|
|
const ClientStartup: React.FC = () => {
|
|
|
|
const loadingContextInfo = useContext(LoadingContext);
|
|
|
|
useEffect(() => {
|
2024-03-22 03:41:32 +08:00
|
|
|
logger.info('Loading client');
|
|
|
|
loadingContextInfo.setLoading(true, '4/4');
|
2024-03-07 01:28:18 +08:00
|
|
|
}, []);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Suspense>
|
|
|
|
{
|
|
|
|
(() => {
|
|
|
|
try {
|
|
|
|
return <MeetingClientLazy />;
|
|
|
|
} catch (error) {
|
|
|
|
loadingContextInfo.setLoading(false, '');
|
|
|
|
throw new Error('Error on rendering MeetingClientLazy: '.concat(JSON.stringify(error) || ''));
|
|
|
|
}
|
|
|
|
})()
|
|
|
|
}
|
|
|
|
</Suspense>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ClientStartup;
|