Skip to content

Commit 79949b7

Browse files
committed
Message List: Fix for paid messages banner (#5799)
1 parent 9636876 commit 79949b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/components/middle/MessageList.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ type StateProps = {
133133
areAdsEnabled?: boolean;
134134
channelJoinInfo?: ApiChatFullInfo['joinInfo'];
135135
isChatProtected?: boolean;
136+
hasCustomGreeting?: boolean;
136137
};
137138

138139
const MESSAGE_REACTIONS_POLLING_INTERVAL = 20 * 1000;
@@ -195,6 +196,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
195196
onIntersectPinnedMessage,
196197
onScrollDownToggle,
197198
onNotchToggle,
199+
hasCustomGreeting,
198200
}) => {
199201
const {
200202
loadViewportMessages, setScrollOffset, loadSponsoredMessages, loadMessageReactions, copyMessagesByIds,
@@ -696,7 +698,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
696698
{restrictionReason ? restrictionReason.text : `This is a private ${isChannelChat ? 'channel' : 'chat'}`}
697699
</span>
698700
</div>
699-
) : paidMessagesStars && isPrivate && !hasMessages ? (
701+
) : paidMessagesStars && isPrivate && !hasMessages && !hasCustomGreeting ? (
700702
<RequirementToContactMessage paidMessagesStars={paidMessagesStars} userId={chatId} />
701703
) : isContactRequirePremium && !hasMessages ? (
702704
<RequirementToContactMessage userId={chatId} />
@@ -795,6 +797,8 @@ export default memo(withGlobal<OwnProps>(
795797
const isCurrentUserPremium = selectIsCurrentUserPremium(global);
796798
const areAdsEnabled = !isCurrentUserPremium || selectUserFullInfo(global, currentUserId)?.areAdsEnabled;
797799

800+
const hasCustomGreeting = Boolean(userFullInfo?.businessIntro);
801+
798802
return {
799803
areAdsEnabled,
800804
isChatLoaded: true,
@@ -828,6 +832,7 @@ export default memo(withGlobal<OwnProps>(
828832
currentUserId,
829833
isChatProtected: selectIsChatProtected(global, chatId),
830834
...(withLastMessageWhenPreloading && { lastMessage }),
835+
hasCustomGreeting,
831836
};
832837
},
833838
)(MessageList));

0 commit comments

Comments
 (0)