Chats: don't render ChatList unless mainWindow is open for performance

actually-fix-tabs-bar
Alex Gleason 2021-07-01 20:14:39 -05:00
rodzic 4f1139d414
commit 67392cbc12
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -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>
); );