Load ChatPanes asynchronously

merge-requests/568/head
Alex Gleason 3 years ago
parent e87affbbca
commit 64b0fa6d99
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

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

@ -210,6 +210,10 @@ export function ChatRoom() {
return import(/* webpackChunkName: "features/chats/chat_room" */'../../chats/chat_room'); 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() { export function ServerInfo() {
return import(/* webpackChunkName: "features/server_info" */'../../server_info'); return import(/* webpackChunkName: "features/server_info" */'../../server_info');
} }

Loading…
Cancel
Save