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

merge-requests/568/head
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() {
const { panes, mainWindowState, unreadCount } = this.props;
const open = mainWindowState === 'open';
const mainWindowPane = (
<div className={`pane pane--main pane--${mainWindowState}`}>
@ -51,10 +52,10 @@ class ChatPanes extends ImmutablePureComponent {
<AudioToggle />
</div>
<div className='pane__content'>
<ChatList
{open && <ChatList
onClickChat={this.handleClickChat}
emptyMessage={<FormattedMessage id='chat_panels.main_window.empty' defaultMessage="No chats found. To start a chat, visit a user's profile." />}
/>
/>}
</div>
</div>
);