chat: always show DMs, add 'no DM' text

This commit is contained in:
Matilde Park 2020-07-16 13:51:23 -04:00
parent 62405ce5d0
commit dbfff9e94b
2 changed files with 18 additions and 15 deletions

View File

@ -65,6 +65,10 @@ export class GroupItem extends Component {
);
});
if (channelItems.length === 0) {
channelItems.push(<p className="gray2 mt4 f9 tc">No direct messages</p>);
}
let dmLink = <div />;
if (props.index === 'dm') {

View File

@ -86,21 +86,20 @@ export class Sidebar extends Component {
/>
);
});
if (groupedChannels['dm'] && groupedChannels['dm'].length !== 0) {
groupedItems.push(
<GroupItem
association={'dm'}
chatMetadata={chatAssoc}
channels={groupedChannels['dm']}
inbox={props.inbox}
station={props.station}
unreads={props.unreads}
index={'dm'}
key={'dm'}
{...props}
/>
);
}
// add direct messages after groups
groupedItems.push(
<GroupItem
association={'dm'}
chatMetadata={chatAssoc}
channels={groupedChannels['dm']}
inbox={props.inbox}
station={props.station}
unreads={props.unreads}
index={'dm'}
key={'dm'}
{...props}
/>
);
return (
<div