Remove getIsConversationEmptySelector in favor of messageCount

This commit is contained in:
Scott Nonnenberg 2021-03-04 10:06:49 -08:00 committed by Josh Perez
parent c9ffb7c014
commit 9e2411ce30
6 changed files with 18 additions and 97 deletions

View file

@ -7,10 +7,7 @@ import {
ConversationHeader,
OutgoingCallButtonStyle,
} from '../../components/conversation/ConversationHeader';
import {
getConversationSelector,
getIsConversationEmptySelector,
} from '../selectors/conversations';
import { getConversationSelector } from '../selectors/conversations';
import { StateType } from '../reducer';
import { CallMode } from '../../types/Calling';
import {
@ -110,10 +107,14 @@ const mapStateToProps = (state: StateType, ownProps: OwnProps) => {
'groupVersion',
]),
conversationTitle: state.conversations.selectedConversationTitle,
isMissingMandatoryProfileSharing:
isMissingMandatoryProfileSharing: Boolean(
!conversation.profileSharing &&
window.Signal.RemoteConfig.isEnabled('desktop.mandatoryProfileSharing') &&
!getIsConversationEmptySelector(state)(id),
window.Signal.RemoteConfig.isEnabled(
'desktop.mandatoryProfileSharing'
) &&
conversation.messageCount &&
conversation.messageCount > 0
),
i18n: getIntl(state),
showBackButton: state.conversations.selectedConversationPanelDepth > 0,
outgoingCallButtonStyle: getOutgoingCallButtonStyle(conversation, state),