display unreadcount in actionpanel even on search mode

This commit is contained in:
Audric Ackermann 2020-01-07 17:11:26 +11:00
parent 277acab2a5
commit 30a1e4da99
2 changed files with 5 additions and 6 deletions

View File

@ -45,6 +45,7 @@ interface Props {
sentFriendsRequest: Array<ConversationListItemPropsType>;
receivedFriendsRequest: Array<ConversationListItemPropsType>;
unreadMessageCount: number;
receivedFriendRequestCount: number;
searchResults?: SearchResultsProps;
searchTerm: string;
isSecondaryDevice: boolean;
@ -171,7 +172,7 @@ export class LeftPane extends React.Component<Props, State> {
selectedSection={this.state.selectedSection}
onSectionSelected={this.handleSectionSelected}
conversations={this.props.conversations}
receivedFriendsRequest={this.props.receivedFriendsRequest}
receivedFriendRequestCount={this.props.receivedFriendRequestCount}
unreadMessageCount={this.props.unreadMessageCount}
/>
<div className="module-left-pane">{this.renderSection()}</div>

View File

@ -20,8 +20,8 @@ interface Props {
onSectionSelected: any;
selectedSection: SectionType;
conversations: Array<ConversationListItemPropsType> | undefined;
receivedFriendsRequest: Array<ConversationListItemPropsType>;
unreadMessageCount: number;
receivedFriendRequestCount: number;
}
const Section = ({
@ -140,12 +140,10 @@ export class ActionsPanel extends React.Component<Props, State> {
public render(): JSX.Element {
const {
selectedSection,
receivedFriendsRequest,
unreadMessageCount,
receivedFriendRequestCount,
} = this.props;
const friendRequestCount = receivedFriendsRequest.length;
const isProfilePageSelected = selectedSection === SectionType.Profile;
const isMessagePageSelected = selectedSection === SectionType.Message;
const isContactPageSelected = selectedSection === SectionType.Contact;
@ -171,7 +169,7 @@ export class ActionsPanel extends React.Component<Props, State> {
type={SectionType.Contact}
isSelected={isContactPageSelected}
onSelect={this.handleSectionSelect}
notificationCount={friendRequestCount}
notificationCount={receivedFriendRequestCount}
/>
<Section
type={SectionType.Globe}