Load ChatPanes asynchronously

merge-requests/568/head
Alex Gleason 2021-07-01 13:43:14 -05:00
rodzic e87affbbca
commit 64b0fa6d99
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -23,6 +23,7 @@ import { openModal } from '../../actions/modal';
import { fetchFollowRequests } from '../../actions/accounts';
import { fetchScheduledStatuses } from '../../actions/scheduled_statuses';
import { WrappedRoute } from './util/react_router_helpers';
import BundleContainer from './containers/bundle_container';
import UploadArea from './components/upload_area';
import TabsBar from './components/tabs_bar';
import LinkFooter from './components/link_footer';
@ -44,7 +45,6 @@ import { connectUserStream } from '../../actions/streaming';
import { Redirect } from 'react-router-dom';
import Icon from 'soapbox/components/icon';
import { isStaff } from 'soapbox/utils/accounts';
import ChatPanes from 'soapbox/features/chats/components/chat_panes';
import ProfileHoverCard from 'soapbox/components/profile_hover_card';
import { getAccessToken } from 'soapbox/utils/auth';
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
@ -95,6 +95,7 @@ import {
MfaForm,
ChatIndex,
ChatRoom,
ChatPanes,
ServerInfo,
Dashboard,
AwaitingApproval,
@ -695,7 +696,11 @@ class UI extends React.PureComponent {
<ModalContainer />
<UploadArea active={draggingOver} onClose={this.closeUploadModal} />
{me && <SidebarMenu />}
{me && !mobile && <ChatPanes />}
{me && !mobile && (
<BundleContainer fetchComponent={ChatPanes}>
{Component => <Component />}
</BundleContainer>
)}
<ProfileHoverCard />
</div>
</HotKeys>

Wyświetl plik

@ -210,6 +210,10 @@ export function ChatRoom() {
return import(/* webpackChunkName: "features/chats/chat_room" */'../../chats/chat_room');
}
export function ChatPanes() {
return import(/* webpackChunkName: "features/chats/components/chat_panes" */'../../chats/components/chat_panes');
}
export function ServerInfo() {
return import(/* webpackChunkName: "features/server_info" */'../../server_info');
}