sforkowany z mirror/soapbox
Chats: don't render ChatList unless mainWindow is open for performance
rodzic
4f1139d414
commit
67392cbc12
|
@ -40,6 +40,7 @@ class ChatPanes extends ImmutablePureComponent {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { panes, mainWindowState, unreadCount } = this.props;
|
const { panes, mainWindowState, unreadCount } = this.props;
|
||||||
|
const open = mainWindowState === 'open';
|
||||||
|
|
||||||
const mainWindowPane = (
|
const mainWindowPane = (
|
||||||
<div className={`pane pane--main pane--${mainWindowState}`}>
|
<div className={`pane pane--main pane--${mainWindowState}`}>
|
||||||
|
@ -51,10 +52,10 @@ class ChatPanes extends ImmutablePureComponent {
|
||||||
<AudioToggle />
|
<AudioToggle />
|
||||||
</div>
|
</div>
|
||||||
<div className='pane__content'>
|
<div className='pane__content'>
|
||||||
<ChatList
|
{open && <ChatList
|
||||||
onClickChat={this.handleClickChat}
|
onClickChat={this.handleClickChat}
|
||||||
emptyMessage={<FormattedMessage id='chat_panels.main_window.empty' defaultMessage="No chats found. To start a chat, visit a user's profile." />}
|
emptyMessage={<FormattedMessage id='chat_panels.main_window.empty' defaultMessage="No chats found. To start a chat, visit a user's profile." />}
|
||||||
/>
|
/>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Ładowanie…
Reference in New Issue