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

@ -10,10 +10,7 @@ import { StateType } from '../reducer';
import { isShortName } from '../../components/emoji/lib';
import { getIntl } from '../selectors/user';
import {
getConversationSelector,
getIsConversationEmptySelector,
} from '../selectors/conversations';
import { getConversationSelector } from '../selectors/conversations';
import {
getBlessedStickerPacks,
getInstalledStickerPacks,
@ -81,10 +78,14 @@ const mapStateToProps = (state: StateType, props: ExternalProps) => {
// Message Requests
...conversation,
conversationType: conversation.type,
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
),
};
};